import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // Dev server proxies /api → the dialectic-backend so the SPA can run // without CORS knobs at dev time. In prod the SPA + backend sit behind // the same hostname (nginx rewrites /api/ → backend container). export default defineConfig({ plugins: [react()], server: { port: 5173, proxy: { '/api': { target: process.env.VITE_DIALECTIC_BACKEND ?? 'http://localhost:8090', changeOrigin: false, }, }, }, build: { outDir: 'dist', sourcemap: true, }, });