Skip to content

Commit b0b6042

Browse files
committed
fix(build): emit Web Workers as ES modules so the kernel worker bundles
The kernel worker imports the full DataLabRuntime, whose dynamic import() calls force code-splitting — incompatible with Vite's default iife worker format, which broke 'npm run build' (and release:pack). Workers are already instantiated with { type: module }, so worker.format='es' is the matching output format. Assisted-by: Claude Opus 4.8
1 parent 713e7b9 commit b0b6042

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎vite.config.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ export default defineConfig({
7777
target: "es2022",
7878
sourcemap: true,
7979
},
80+
// Build Web Workers as ES modules. The kernel worker
81+
// (``src/runtime/kernelWorker.ts``) imports the full ``DataLabRuntime``,
82+
// whose dynamic ``import()`` calls force code-splitting — incompatible
83+
// with Vite's default ``iife`` worker format. We already instantiate
84+
// every worker with ``{ type: "module" }``, so an ES worker bundle is
85+
// the matching (and only valid) output format.
86+
worker: {
87+
format: "es",
88+
},
8089
// Make Python source files importable as raw strings.
8190
assetsInclude: ["**/*.py"],
8291
});

0 commit comments

Comments
 (0)