fix(cli): mark react-devtools-core external in bun compile

ink@6 has a devtools.js module that imports react-devtools-core. It is
only loaded at runtime when DEV=true, but Bun's static bundler still
tries to resolve it at compile time and fails with "Could not resolve".
Marking it external lets the compile succeed; the dynamic import path
is never taken in production.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-26 15:03:12 -07:00
parent 5937910e8d
commit 19c75e0b39

View File

@@ -338,6 +338,10 @@ function compileBinary(outFile: string, target: string, isCrossCompile: boolean)
target,
"--minify",
"--conditions=source",
// ink imports react-devtools-core dynamically only when DEV=true; mark
// external so Bun's static bundler doesn't try to resolve it at compile.
"--external",
"react-devtools-core",
],
cwd: workspaceRoot,
stdout: "inherit",