0
|
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));
|