diff --git a/build.bun.ts b/build.bun.ts index d6cccabe..0e534189 100644 --- a/build.bun.ts +++ b/build.bun.ts @@ -7,7 +7,10 @@ await $`tsc`; const isDevelopment = Bun.env.NODE_ENV === "development"; // Build all JavaScript/TypeScript files -function buildJs(entrypoint: string, opts: Record = {}) { +function buildJs( + entrypoint: string, + opts: Partial[0]> = {}, +) { return Bun.build({ entrypoints: [entrypoint], outdir: "dist", @@ -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"], @@ -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"], diff --git a/package.json b/package.json index 2291a5f5..b8490ae0 100644 --- a/package.json +++ b/package.json @@ -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"