-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathesbuild.mjs
More file actions
28 lines (25 loc) · 727 Bytes
/
Copy pathesbuild.mjs
File metadata and controls
28 lines (25 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as esbuild from 'esbuild';
/** @type {esbuild.BuildOptions} */
const options = {
entryPoints: ['src/extension.ts'],
bundle: true,
outfile: 'out/main.js',
// vscode is provided by VS Code at runtime, must be external
// puppeteer/puppeteer-core JS code is bundled, binary (Chromium) is handled separately
external: [
'vscode',
],
platform: 'node',
format: 'cjs',
sourcemap: true,
minify: false,
keepNames: true,
};
const watch = process.argv.includes('--watch');
if (watch) {
const ctx = await esbuild.context(options);
await ctx.watch();
console.log('[watch] build finished, watching for changes...');
} else {
await esbuild.build(options);
}