Skip to content

Commit e078250

Browse files
authored
build app-with-deps (#221)
1 parent 2730f79 commit e078250

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

build.bun.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ await $`tsc`;
77
const isDevelopment = Bun.env.NODE_ENV === "development";
88

99
// Build all JavaScript/TypeScript files
10-
function buildJs(entrypoint: string, opts: Record<string, any> = {}) {
10+
function buildJs(
11+
entrypoint: string,
12+
opts: Partial<Parameters<(typeof Bun)["build"]>[0]> = {},
13+
) {
1114
return Bun.build({
1215
entrypoints: [entrypoint],
1316
outdir: "dist",
@@ -27,6 +30,10 @@ await Promise.all([
2730
outdir: "dist/src",
2831
external: ["@modelcontextprotocol/sdk"],
2932
}),
33+
buildJs("src/app.ts", {
34+
outdir: "dist/src",
35+
naming: { entry: "app-with-deps.js" },
36+
}),
3037
buildJs("src/app-bridge.ts", {
3138
outdir: "dist/src",
3239
external: ["@modelcontextprotocol/sdk"],
@@ -35,6 +42,11 @@ await Promise.all([
3542
outdir: "dist/src/react",
3643
external: ["react", "react-dom", "@modelcontextprotocol/sdk"],
3744
}),
45+
buildJs("src/react/index.tsx", {
46+
outdir: "dist/src/react",
47+
external: ["react", "react-dom", "@modelcontextprotocol/sdk"],
48+
naming: { entry: "react-with-deps.js" },
49+
}),
3850
buildJs("src/server/index.ts", {
3951
outdir: "dist/src/server",
4052
external: ["@modelcontextprotocol/sdk"],

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@
1515
"types": "./dist/src/app.d.ts",
1616
"default": "./dist/src/app.js"
1717
},
18+
"./app-with-deps": {
19+
"types": "./dist/src/app.d.ts",
20+
"default": "./dist/src/app-with-deps.js"
21+
},
1822
"./react": {
1923
"types": "./dist/src/react/index.d.ts",
2024
"default": "./dist/src/react/index.js"
2125
},
26+
"./react-with-deps": {
27+
"types": "./dist/src/react/index.d.ts",
28+
"default": "./dist/src/react/react-with-deps.js"
29+
},
2230
"./app-bridge": {
2331
"types": "./dist/src/app-bridge.d.ts",
2432
"default": "./dist/src/app-bridge.js"

0 commit comments

Comments
 (0)