-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.js
32 lines (31 loc) · 810 Bytes
/
build.js
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
30
31
32
const { build } = require("esbuild")
const eslint = require('esbuild-plugin-eslint');
const isProd = process.argv.indexOf('--mode=production') >= 0;
build({
entryPoints: ['./src/extension.ts'],
bundle: true,
outfile: "out/extension.js",
external: ['vscode'],
format: 'cjs',
platform: 'node',
// logLevel: 'error',
metafile: true,
// sourceRoot: __dirname+"/src",
minify: isProd,
watch: !isProd,
sourcemap: !isProd,
plugins: [
eslint(),
{
name: 'build notice',
setup(build) {
build.onStart(() => {
console.log('build start')
})
build.onEnd(() => {
console.log('build success')
})
}
},
],
})