-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathesbuild.mjs
More file actions
26 lines (23 loc) · 648 Bytes
/
esbuild.mjs
File metadata and controls
26 lines (23 loc) · 648 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
// ABOUTME: esbuild script for bundling the VS Code extension.
// ABOUTME: Produces a single CJS file in dist/ with vscode marked as external.
import esbuild from "esbuild";
const watch = process.argv.includes("--watch");
/** @type {import('esbuild').BuildOptions} */
const options = {
entryPoints: ["src/extension.ts"],
bundle: true,
outfile: "dist/extension.js",
external: ["vscode"],
format: "cjs",
platform: "node",
target: "node22",
sourcemap: true,
minify: !watch,
};
if (watch) {
const ctx = await esbuild.context(options);
await ctx.watch();
console.log("Watching...");
} else {
await esbuild.build(options);
}