import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' const BACKEND = process.env.XENIA_BACKEND || 'http://localhost:8000' export default defineConfig({ plugins: [react()], // npm workspace (D-15): shared packages are imported from source; one React for all. resolve: { dedupe: ['react', 'react-dom'], }, server: { host: '0.0.0.0', port: 5175, // Same origin in production (the image's nginx forwards /api); in dev Vite does it. // XENIA_BACKEND picks another backend (the e2e suites run their own). proxy: { '/api/ws': { target: BACKEND.replace(/^http/, 'ws'), ws: true, changeOrigin: true }, '/api': { target: BACKEND, changeOrigin: true }, '/static': { target: BACKEND, changeOrigin: true }, }, }, })