build app-with-deps (#221)
This commit is contained in:
parent
2730f796f7
commit
e078250adf
2 changed files with 21 additions and 1 deletions
14
build.bun.ts
14
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<string, any> = {}) {
|
||||
function buildJs(
|
||||
entrypoint: string,
|
||||
opts: Partial<Parameters<(typeof Bun)["build"]>[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"],
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue