fix(mcp): keep yaml external in tsup bundle for Docker ESM runtime
Inlining yaml into the MCP ESM bundle caused dynamic require("process") crashes in production. Externalize yaml for mcp-server, orchestrator, and worker builds.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8e1ab90fb1
commit
3e33cab2d6
3 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
import { defineConfig } from "tsup";
|
import { defineConfig } from "tsup";
|
||||||
|
|
||||||
|
/** `yaml` uses dynamic require internally and breaks when inlined into ESM. */
|
||||||
|
const bundledDatabaseExternals = ["yaml"] as const;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
entry: ["src/index.ts"],
|
entry: ["src/index.ts"],
|
||||||
format: ["esm"],
|
format: ["esm"],
|
||||||
|
|
@ -9,6 +12,7 @@ export default defineConfig({
|
||||||
// at import time — Node 20 cannot load .ts. Third-party deps stay external
|
// at import time — Node 20 cannot load .ts. Third-party deps stay external
|
||||||
// and are installed via the regular node_modules layer in the runtime image.
|
// and are installed via the regular node_modules layer in the runtime image.
|
||||||
noExternal: [/^@tasks\//],
|
noExternal: [/^@tasks\//],
|
||||||
|
external: [...bundledDatabaseExternals],
|
||||||
target: "node20",
|
target: "node20",
|
||||||
platform: "node",
|
platform: "node",
|
||||||
clean: true,
|
clean: true,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
import { defineConfig } from "tsup";
|
import { defineConfig } from "tsup";
|
||||||
|
|
||||||
|
const bundledDatabaseExternals = ["yaml"] as const;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
entry: ["src/index.ts"],
|
entry: ["src/index.ts"],
|
||||||
format: ["esm"],
|
format: ["esm"],
|
||||||
dts: true,
|
dts: true,
|
||||||
noExternal: [/^@tasks\//],
|
noExternal: [/^@tasks\//],
|
||||||
|
external: [...bundledDatabaseExternals],
|
||||||
target: "node20",
|
target: "node20",
|
||||||
platform: "node",
|
platform: "node",
|
||||||
clean: true,
|
clean: true,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
import { defineConfig } from "tsup";
|
import { defineConfig } from "tsup";
|
||||||
|
|
||||||
|
const bundledDatabaseExternals = ["yaml"] as const;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
entry: ["src/index.ts"],
|
entry: ["src/index.ts"],
|
||||||
format: ["esm"],
|
format: ["esm"],
|
||||||
dts: true,
|
dts: true,
|
||||||
noExternal: [/^@tasks\//],
|
noExternal: [/^@tasks\//],
|
||||||
|
external: [...bundledDatabaseExternals],
|
||||||
target: "node20",
|
target: "node20",
|
||||||
platform: "node",
|
platform: "node",
|
||||||
clean: true,
|
clean: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue