-
Notifications
You must be signed in to change notification settings - Fork 7
/
.esbuild.js
39 lines (36 loc) · 962 Bytes
/
.esbuild.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
33
34
35
36
37
38
39
const esbuild = require("esbuild");
const watch = process.argv.includes("--watch");
const minify = watch ? process.argv.includes("--minify") : !process.argv.includes("--no-minify");
const ctx = esbuild.context({
entryPoints: [
"src/extension.ts",
"src/test/run.ts",
"src/test/workspace-runner.ts",
"src/runner-loader.ts",
"src/runner-worker.ts",
],
tsconfig: "./tsconfig.json",
bundle: true,
external: ["vscode", "esbuild", "mocha", "monocart-coverage-reports"],
sourcemap: !minify,
minify,
platform: "node",
target: "node20",
outdir: "out",
plugins: [
{
name: "alias-module",
setup: (build) => {
build.onResolve({ filter: /^istanbul-reports$/ }, () => ({
path: `${__dirname}/src/istanbul-reports-stub.ts`,
}));
},
},
],
});
ctx
.then((ctx) => (watch ? ctx.watch() : ctx.rebuild()))
.then(
() => !watch && process.exit(0),
() => process.exit(1),
);