-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesbuild.mjs
More file actions
32 lines (27 loc) · 824 Bytes
/
esbuild.mjs
File metadata and controls
32 lines (27 loc) · 824 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
import * as esbuild from "esbuild";
const isWatch = process.argv.includes("--watch");
/** Shared options */
const common = {
bundle: true,
platform: "node",
target: "node18",
sourcemap: true,
format: "cjs",
minify: false,
};
// 1. VSCode extension entry point — exclude vscode (provided by host)
const extensionBuild = esbuild.build({
...common,
entryPoints: ["src/extension.ts"],
outfile: "out/extension.js",
external: ["vscode"],
});
// 2. Standalone MCP server — bundle everything (no external deps at runtime)
const standaloneBuild = esbuild.build({
...common,
entryPoints: ["src/mcp/standalone.ts"],
outfile: "out/mcp/standalone.js",
external: [], // bundle all deps including MCP SDK and zod
});
await Promise.all([extensionBuild, standaloneBuild]);
console.log("Build complete");