23 lines
443 B
JavaScript
23 lines
443 B
JavaScript
import * as esbuild from "esbuild";
|
|
|
|
const watch = process.argv.includes("--watch");
|
|
const options = {
|
|
entryPoints: ["src/extension.ts"],
|
|
bundle: true,
|
|
outfile: "dist/extension.js",
|
|
external: ["vscode"],
|
|
format: "cjs",
|
|
platform: "node",
|
|
target: "node20",
|
|
sourcemap: true,
|
|
logLevel: "info"
|
|
};
|
|
|
|
if (watch) {
|
|
const context = await esbuild.context(options);
|
|
await context.watch();
|
|
} else {
|
|
await esbuild.build(options);
|
|
}
|
|
|