import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react-swc'; // The production API base URL is stamped at build time via VITE_API_BASE_URL (empty in // production, where nginx serves this SPA and proxies /v1 and /health under one origin). // In dev we proxy to the local API daemon so the browser stays same-origin. export default defineConfig({ plugins: [react()], server: { port: 5173, proxy: { '/v1': 'http://127.0.0.1:8081', '/health': 'http://127.0.0.1:8081', }, }, build: { outDir: 'dist', sourcemap: true, }, });