import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; export default defineConfig({ plugins: [react()], server: { port: 5173, // The dev server proxies the API so the browser only ever talks to one // origin. No CORS config on the server, and cookies behave the same in // development as they will in production behind Caddy. proxy: { "/api": { target: "http://127.0.0.1:8090", changeOrigin: true, }, }, }, build: { // Caddy serves this directory as static files. Nothing here runs on the // server; the whole app is built on the dev machine (SPEC 6). outDir: "dist", sourcemap: true, }, });