import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // In development the frontend runs on 5173 and the backend on 8081; everything under // /api - including the websocket upgrade - is proxied there, so the browser sees one // origin and there is no CORS to configure on either side. export default defineConfig({ plugins: [react()], server: { port: 5173, proxy: { "/api": { target: "http://127.0.0.1:8081", changeOrigin: true, ws: true }, }, }, build: { outDir: "dist", emptyOutDir: true }, });