-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathbuild.js
More file actions
29 lines (29 loc) · 624 Bytes
/
build.js
File metadata and controls
29 lines (29 loc) · 624 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
29
// @ts-check
require('esbuild').context({
entryPoints: {
extension: './src/extension.ts',
},
sourcemap: true,
bundle: true,
metafile: process.argv.includes('--metafile'),
outdir: './dist',
external: [
'vscode',
],
format: 'cjs',
platform: 'node',
tsconfig: './tsconfig.json',
define: { 'process.env.NODE_ENV': '"production"' },
minify: process.argv.includes('--minify'),
}).then(async ctx => {
console.log('building...');
if (process.argv.includes('--watch')) {
await ctx.watch();
console.log('watching...');
}
else {
await ctx.rebuild();
await ctx.dispose();
console.log('finished.');
}
});