diff options
Diffstat (limited to 'esbuild.config.mjs')
| -rw-r--r-- | esbuild.config.mjs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/esbuild.config.mjs b/esbuild.config.mjs new file mode 100644 index 0000000..d1c1ba2 --- /dev/null +++ b/esbuild.config.mjs @@ -0,0 +1,27 @@ +import esbuild from "esbuild"; +import process from "process"; + +const banner = +`/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source visit the plugins github repository +*/ +`; + +const prod = (process.argv[2] === 'production'); + +esbuild.build({ + banner: { + js: banner, + }, + entryPoints: ['main.ts'], + bundle: true, + external: ['obsidian'], + format: 'cjs', + watch: !prod, + target: 'es2016', + logLevel: "info", + sourcemap: prod ? false : 'inline', + treeShaking: true, + outfile: 'main.js', +}).catch(() => process.exit(1)); |
