Update build script to include external node packages.

This commit is contained in:
lishid committed 2021-11-01 15:18:11 -04:00
1 parent 6fdd374cb8
commit db18a36e65
3 files changed
+24 -20

No files matched your search

+16 -15
View File
@@ -1,27 +1,28 @@
import esbuild from "esbuild";
import process from "process";
import builtins from 'builtin-modules'
const banner =
const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
if you want to view the source, please visit the github repository of this plugin
*/
`;
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',
banner: {
js: banner,
},
entryPoints: ['main.ts'],
bundle: true,
external: ['obsidian', 'electron', ...builtins],
format: 'cjs',
watch: !prod,
target: 'es2016',
logLevel: "info",
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: 'main.js',
}).catch(() => process.exit(1));