Files
Kilo-Org_kilocode/packages/opencode/script
Catriel Müller bd1e3e4a14 fix(cli): use build plugin to redirect morphsdk ESM barrel to CJS
The createRequire approach from #10955 did not prevent the Bun ESM
splitter from generating invalid output. Bun 1.3.14 with
`conditions: ["browser"]` resolves @morphllm/morphsdk via the "import"
condition (pre-split ESM barrel) even inside createRequire() calls,
pulling in 52 chunk-*.js files that cause:

  SyntaxError: Exported binding 'G9' needs to refer to a top-level declared variable.

Fix: add a morphsdkCjsPlugin in script/build.ts using Bun's onResolve
API to redirect the module specifier to the absolute path of client.cjs
before the ESM splitter is invoked. client.cjs is a self-contained
~2300-line CJS bundle with no chunk-*.js imports.

morphsdk.ts is simplified to a plain re-export — the CJS redirection
happens at build time, no source-level workaround needed.
2026-06-05 15:52:14 -03:00
..
2026-02-14 04:19:02 +00:00
2026-04-20 18:29:48 +00:00
2026-06-01 12:51:31 +02:00
2026-05-06 14:26:06 -03:00
2026-04-16 10:09:14 -04:00