Mercurial > obsidian-remember-file-state
comparison esbuild.config.mjs @ 0:7975d7c73f8a 1.0.0
Initial commit
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 08 Feb 2022 21:40:33 -0800 |
parents | |
children | 2a9e941c96ee |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7975d7c73f8a |
---|---|
1 import esbuild from "esbuild"; | |
2 import process from "process"; | |
3 import builtins from 'builtin-modules' | |
4 | |
5 const banner = | |
6 `/* | |
7 THIS IS A GENERATED/BUNDLED FILE BY ESBUILD | |
8 if you want to view the source, please visit the github repository of this plugin | |
9 */ | |
10 `; | |
11 | |
12 const prod = (process.argv[2] === 'production'); | |
13 | |
14 esbuild.build({ | |
15 banner: { | |
16 js: banner, | |
17 }, | |
18 entryPoints: ['src/main.ts'], | |
19 bundle: true, | |
20 external: [ | |
21 'obsidian', | |
22 'electron', | |
23 '@codemirror', | |
24 '@codemirror/state', | |
25 '@codemirror/view', | |
26 ...builtins | |
27 ], | |
28 format: 'cjs', | |
29 watch: !prod, | |
30 target: 'es2016', | |
31 logLevel: "info", | |
32 sourcemap: prod ? false : 'inline', | |
33 treeShaking: true, | |
34 outfile: 'main.js', | |
35 }).catch(() => process.exit(1)); |