import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // Dev proxy targets the local GuruConnect (GC) server. `/api` and `/ws` are // forwarded to the Rust server on :3002 so `npm run dev` works against a real // backend without CORS gymnastics. // // `base` is "./" so the built assets reference relative paths — production // serving copies `dist/` into the server's static dir and a catch-all route // serves index.html. Wiring that catch-all in the Rust server is a DEPLOY // concern (see README), not done in this pass. const GC_SERVER = "http://localhost:3002"; export default defineConfig({ base: "./", plugins: [react()], server: { port: 5273, proxy: { "/api": { target: GC_SERVER, changeOrigin: true, }, "/ws": { target: GC_SERVER, changeOrigin: true, ws: true, }, }, }, build: { outDir: "dist", sourcemap: true, }, });