fix: pre-bundle xterm packages to resolve MIME type error in terminal

Vite's dev server was returning HTML error pages instead of JS for
dynamically imported @xterm/* modules, causing 'text/html is not a
valid JavaScript MIME type' failures during terminal initialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-04 14:02:13 -07:00
parent aac5297154
commit 22d8d7254c

View File

@@ -10,6 +10,14 @@ export default defineConfig({
"@fusion/core": resolve(__dirname, "../core/src/types.ts"),
},
},
optimizeDeps: {
include: [
"@xterm/xterm",
"@xterm/addon-fit",
"@xterm/addon-web-links",
"@xterm/addon-webgl",
],
},
build: {
outDir: "../dist/client",
emptyOutDir: true,