-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathesbuild.config.js
More file actions
51 lines (46 loc) · 1.13 KB
/
Copy pathesbuild.config.js
File metadata and controls
51 lines (46 loc) · 1.13 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
import * as esbuild from "esbuild";
import { readFileSync } from "node:fs";
const pkg = JSON.parse(readFileSync("package.json", "utf-8"));
const shared = {
bundle: true,
platform: "node",
format: "esm",
target: "node24",
sourcemap: true,
external: [
// Keep node_modules external — they'll be resolved at runtime
"@a2a-js/sdk",
"@a2a-js/sdk/server",
"@a2a-js/sdk/server/express",
"@a2a-js/sdk/client",
"@modelcontextprotocol/sdk",
"@modelcontextprotocol/sdk/server/mcp.js",
"@modelcontextprotocol/sdk/server/stdio.js",
"express",
"jsonwebtoken",
"pino",
"yaml",
"zod",
"uuid",
"better-sqlite3",
],
define: {
__VERSION__: JSON.stringify(pkg.version),
},
banner: {
js: 'import { createRequire } from "module"; const require = createRequire(import.meta.url);',
},
};
// Server CLI
await esbuild.build({
...shared,
entryPoints: ["src/cli.ts"],
outfile: "dist/cli.js",
});
// MCP Client
await esbuild.build({
...shared,
entryPoints: ["src/client/index.ts"],
outfile: "dist/client.js",
});
console.log("Build complete: dist/cli.js, dist/client.js");