Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion build.bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ await $`tsc`;
const isDevelopment = Bun.env.NODE_ENV === "development";

// Build all JavaScript/TypeScript files
function buildJs(entrypoint: string, opts: Record<string, any> = {}) {
function buildJs(
entrypoint: string,
opts: Partial<Parameters<(typeof Bun)["build"]>[0]> = {},
) {
return Bun.build({
entrypoints: [entrypoint],
outdir: "dist",
Expand All @@ -27,6 +30,10 @@ await Promise.all([
outdir: "dist/src",
external: ["@modelcontextprotocol/sdk"],
}),
buildJs("src/app.ts", {
outdir: "dist/src",
naming: { entry: "app-with-deps.js" },
}),
buildJs("src/app-bridge.ts", {
outdir: "dist/src",
external: ["@modelcontextprotocol/sdk"],
Expand All @@ -35,6 +42,11 @@ await Promise.all([
outdir: "dist/src/react",
external: ["react", "react-dom", "@modelcontextprotocol/sdk"],
}),
buildJs("src/react/index.tsx", {
outdir: "dist/src/react",
external: ["react", "react-dom", "@modelcontextprotocol/sdk"],
naming: { entry: "react-with-deps.js" },
}),
buildJs("src/server/index.ts", {
outdir: "dist/src/server",
external: ["@modelcontextprotocol/sdk"],
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@
"types": "./dist/src/app.d.ts",
"default": "./dist/src/app.js"
},
"./app-with-deps": {
"types": "./dist/src/app.d.ts",
"default": "./dist/src/app-with-deps.js"
},
"./react": {
"types": "./dist/src/react/index.d.ts",
"default": "./dist/src/react/index.js"
},
"./react-with-deps": {
"types": "./dist/src/react/index.d.ts",
"default": "./dist/src/react/react-with-deps.js"
},
"./app-bridge": {
"types": "./dist/src/app-bridge.d.ts",
"default": "./dist/src/app-bridge.js"
Expand Down
Loading