mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 01:08:32 +00:00
fix(desktop): stabilize esm shim injection (#35270)
This commit is contained in:
parent
8b6a2b173b
commit
f63a451b6f
1 changed files with 11 additions and 0 deletions
|
|
@ -39,6 +39,17 @@ export default defineConfig({
|
|||
build: {
|
||||
rollupOptions: {
|
||||
input: { index: "src/main/index.ts", sidecar: "src/main/sidecar.ts" },
|
||||
// Keep this identical to electron-vite's Node 20.11+ shim. Its regex insertion can
|
||||
// corrupt bundled TypeScript, while a Rollup banner places the shim safely.
|
||||
output: {
|
||||
banner: `
|
||||
// -- CommonJS Shims --
|
||||
import __cjs_mod__ from 'node:module';
|
||||
const __filename = import.meta.filename;
|
||||
const __dirname = import.meta.dirname;
|
||||
const require = __cjs_mod__.createRequire(import.meta.url);
|
||||
`,
|
||||
},
|
||||
},
|
||||
externalizeDeps: { include: [nodePtyPkg] },
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue