Mercurial > obsidian-remember-file-state
comparison esbuild.config.mjs @ 19:2a9e941c96ee
Bring new build tools from the sample plugin project
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 18 Mar 2022 19:19:18 -0700 |
parents | 7975d7c73f8a |
children | 61fd7dde51d3 |
comparison
equal
deleted
inserted
replaced
18:131ae934ea07 | 19:2a9e941c96ee |
---|---|
8 if you want to view the source, please visit the github repository of this plugin | 8 if you want to view the source, please visit the github repository of this plugin |
9 */ | 9 */ |
10 `; | 10 `; |
11 | 11 |
12 const prod = (process.argv[2] === 'production'); | 12 const prod = (process.argv[2] === 'production'); |
13 const outdir = (process.argv[2] === 'dogfood' ? process.argv[3] : ''); | |
14 | |
15 const dirsep = (outdir.slice(-1) == '/' || outdir.slice(-1) == "\\") ? '' : '/'; | |
16 const outfile = outdir + dirsep + 'main.js'; | |
13 | 17 |
14 esbuild.build({ | 18 esbuild.build({ |
15 banner: { | 19 banner: { |
16 js: banner, | 20 js: banner, |
17 }, | 21 }, |
18 entryPoints: ['src/main.ts'], | 22 entryPoints: ['src/main.ts'], |
19 bundle: true, | 23 bundle: true, |
20 external: [ | 24 external: [ |
21 'obsidian', | 25 'obsidian', |
22 'electron', | 26 'electron', |
23 '@codemirror', | 27 '@codemirror/autocomplete', |
24 '@codemirror/state', | 28 '@codemirror/closebrackets', |
25 '@codemirror/view', | 29 '@codemirror/collab', |
26 ...builtins | 30 '@codemirror/commands', |
27 ], | 31 '@codemirror/comment', |
32 '@codemirror/fold', | |
33 '@codemirror/gutter', | |
34 '@codemirror/highlight', | |
35 '@codemirror/history', | |
36 '@codemirror/language', | |
37 '@codemirror/lint', | |
38 '@codemirror/matchbrackets', | |
39 '@codemirror/panel', | |
40 '@codemirror/rangeset', | |
41 '@codemirror/rectangular-selection', | |
42 '@codemirror/search', | |
43 '@codemirror/state', | |
44 '@codemirror/stream-parser', | |
45 '@codemirror/text', | |
46 '@codemirror/tooltip', | |
47 '@codemirror/view', | |
48 ...builtins], | |
28 format: 'cjs', | 49 format: 'cjs', |
29 watch: !prod, | 50 watch: !prod, |
30 target: 'es2016', | 51 target: 'es2016', |
31 logLevel: "info", | 52 logLevel: "info", |
32 sourcemap: prod ? false : 'inline', | 53 sourcemap: prod ? false : 'inline', |
33 treeShaking: true, | 54 treeShaking: true, |
34 outfile: 'main.js', | 55 outfile: outfile, |
35 }).catch(() => process.exit(1)); | 56 }).catch(() => process.exit(1)); |