Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-sc committed Jul 11, 2024
1 parent 1b03522 commit 3f60d0c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store

env.mjs
94 changes: 47 additions & 47 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,51 @@ const plugins = prod
'./manifest.json': `${obsidianExportPath}/manifest.json`,
'./src/styles.css': `${obsidianExportPath}/styles.css`,
}),
];
];

esbuild
.build({
banner: {
js: banner,
},
entryPoints: ['src/main.ts'],
bundle: true,
external: [
'obsidian',
'electron',
'@codemirror/autocomplete',
'@codemirror/closebrackets',
'@codemirror/collab',
'@codemirror/commands',
'@codemirror/comment',
'@codemirror/fold',
'@codemirror/gutter',
'@codemirror/highlight',
'@codemirror/history',
'@codemirror/language',
'@codemirror/lint',
'@codemirror/matchbrackets',
'@codemirror/panel',
'@codemirror/rangeset',
'@codemirror/rectangular-selection',
'@codemirror/search',
'@codemirror/state',
'@codemirror/stream-parser',
'@codemirror/text',
'@codemirror/tooltip',
'@codemirror/view',
'@lezer/common',
'@lezer/highlight',
'@lezer/lr',
...builtins,
],
format: 'cjs',
watch: !prod,
target: 'es2016',
logLevel: 'info',
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: 'main.js',
plugins,
})
.catch(() => process.exitCode = 1);
const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ['src/main.ts'],
bundle: true,
external: [
'obsidian',
'electron',
'@codemirror/autocomplete',
'@codemirror/closebrackets',
'@codemirror/collab',
'@codemirror/commands',
'@codemirror/comment',
'@codemirror/fold',
'@codemirror/gutter',
'@codemirror/highlight',
'@codemirror/history',
'@codemirror/language',
'@codemirror/lint',
'@codemirror/matchbrackets',
'@codemirror/panel',
'@codemirror/rangeset',
'@codemirror/rectangular-selection',
'@codemirror/search',
'@codemirror/state',
'@codemirror/stream-parser',
'@codemirror/text',
'@codemirror/tooltip',
'@codemirror/view',
'@lezer/common',
'@lezer/highlight',
'@lezer/lr',
...builtins,
],
format: 'cjs',
target: 'es2016',
logLevel: 'info',
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: 'main.js',
plugins,
});

await context.rebuild();
process.exit(0);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enhanced-symbols-prettifier",
"version": "1.0.0",
"version": "1.0.1",
"description": "Replace/substitute the symbols with actual symbols you commonly type. It also works for emojis shortcuts, abbreviations, greek letters, math symbols or other snippets/aliases you define",
"main": "main.js",
"scripts": {
Expand All @@ -15,7 +15,7 @@
"type": "git",
"url": "git+https://github.com/noam-sc/obsidian-enhanced-symbols-prettifier.git"
},
"author": "Noam Schmitt",
"author": "Noam Schmitt & Florian Woelki",
"license": "MIT",
"devDependencies": {
"@types/node": "^16.11.6",
Expand Down

0 comments on commit 3f60d0c

Please sign in to comment.