import { defineConfig, loadEnv } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig(({ mode }) => { // Load all .env vars (no prefix filter) so server-only vars like DEV_API_TARGET // are available here without being exposed to the browser bundle. const env = loadEnv(mode, process.cwd(), '') const base = env.VITE_BASE || '/' const apiTarget = env.DEV_API_TARGET || 'http://127.0.0.1:3201' return { base, plugins: [react()], server: { proxy: { '/v1': { target: apiTarget, changeOrigin: true, }, }, }, } })