import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { fileURLToPath, URL } from 'node:url'; export default defineConfig({ plugins: [react()], css: { // Inline postcss config avoids dynamic package resolution issues postcss: { plugins: [] } }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }, server: { port: 3001, strictPort: true, host: true, open: true, // Proxy API calls through Vite so the browser makes same-origin requests. // This sidesteps the backend's localhost-only CORS allowlist entirely — // works whether you open the app on localhost, a LAN IP, or a hostname. proxy: { // Change `target` if you point the dev app at a different backend. '/api': { target: 'https://api.doormile.com', changeOrigin: true, secure: true } } } });