-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathesbuild.config.js
More file actions
37 lines (32 loc) · 673 Bytes
/
esbuild.config.js
File metadata and controls
37 lines (32 loc) · 673 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
30
31
32
33
34
35
36
37
// @ts-check
const esbuild = require("esbuild");
/** @type {esbuild.BuildOptions} */
const base = {
entryPoints: ["src/extension.ts"],
bundle: true,
outfile: "out/extension.js",
platform: "node",
format: "cjs",
external: ["vscode"],
};
/** @type {esbuild.BuildOptions} */
const watch = {
...base,
logLevel: "debug",
sourcemap: true,
};
/** @type {esbuild.BuildOptions} */
const build = {
...base,
logLevel: "info",
minify: true,
};
async function main() {
if (process.argv[2] === "watch") {
let ctx = await esbuild.context(watch);
ctx.watch();
} else if (process.argv[2] === "build") {
await esbuild.build(build);
}
}
main();