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>
31 lines
590 B
TypeScript
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",
|
|
},
|
|
},
|
|
});
|