Files
fusion/packages/dashboard/vite.config.ts
gsxdsm ed84a728c2 feat(FN-1093): add mobile build, PWA, and live reload workflow
- Optimize dashboard Vite output for mobile and include vite/client types in app typecheck
- Add PWA support with manifest, service worker, icons, and client registration hooks
- Add a mobile workspace package with Capacitor config and live-reload scripts for local development
- Add a dedicated GitHub Actions mobile pipeline and update mobile workflow documentation
- Add dashboard tests for build output, mobile scripts, and PWA asset coverage
2026-04-07 23:25:34 -07:00

57 lines
1.3 KiB
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,
target: "es2022",
cssCodeSplit: true,
sourcemap: false,
assetsInlineLimit: 4096,
rollupOptions: {
output: {
entryFileNames: "assets/[name]-[hash].js",
chunkFileNames: "assets/[name]-[hash].js",
assetFileNames: "assets/[name]-[hash][extname]",
manualChunks: (id) => {
if (id.includes("/node_modules/react/") || id.includes("/node_modules/react-dom/")) {
return "vendor-react";
}
if (id.includes("/node_modules/@xterm/xterm/")) {
return "vendor-xterm";
}
if (id.includes("/node_modules/@codemirror/")) {
return "vendor-codemirror";
}
return undefined;
},
},
},
},
server: {
proxy: {
"/api": "http://localhost:3000",
},
},
});