import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // dashboard-v2 → served by `claw-store serve` under /v2/*. // Base path lines up with the cutover plan in docs/dashboard-v2.md. // During local dev the daemon proxies /api/v2/* on :7700 so // `vite dev` on :5173 can hit it via server.proxy. export default defineConfig({ // Relative base so the SPA works under any mount point (/v2/, // /clawstor/, or bare /). The no-trailing-slash edge case // (browser treats the path as a file and strips the last segment) // is handled server-side: serve.rs redirects /v2 → /v2/ and // /clawstor → /clawstor/ before serving the SPA. base: './', plugins: [react()], server: { port: 5173, proxy: { '/api/v2': { target: 'http://127.0.0.1:7700', changeOrigin: true, }, }, }, build: { outDir: 'dist', emptyOutDir: true, }, });