import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // In Docker the backend is reachable under its service name, locally under localhost. const API_TARGET = process.env.VITE_API_TARGET || 'http://localhost:4000' export default defineConfig({ plugins: [react()], server: { host: '0.0.0.0', port: 5173, strictPort: true, // Needed for file-watching to work through a bind mount inside Docker. watch: { usePolling: true, interval: 300 }, proxy: { '/api': { target: API_TARGET, changeOrigin: true }, '/ws': { target: API_TARGET, changeOrigin: true, ws: true }, }, }, })