import path from 'node:path' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { '@': path.resolve(import.meta.dirname, './src'), }, }, server: { port: 5173, // Proxy API calls in dev so the browser talks to same-origin /api, // avoiding CORS. The API key is sent as a header, never in the URL. proxy: { '/api': { target: process.env.VITE_API_TARGET ?? 'http://10.0.1.235:8000', changeOrigin: true, rewrite: (p) => p.replace(/^\/api/, ''), }, }, }, })