Files
fusion/packages/dashboard/vite.config.ts
gsxdsm 864296edc2 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>
2026-04-04 14:02:13 -07:00

31 lines
590 B
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "node:path";
export default defineConfig({
root: "app",
plugins: [react()],
resolve: {
alias: {
"@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,
},
server: {
proxy: {
"/api": "http://localhost:3000",
},
},
});