import { defineConfig, loadEnv } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '') const raw = (env.VITE_BASE_PATH || '').trim() const base = raw === '' ? '/' : raw.endsWith('/') ? raw : `${raw}/` return { base, plugins: [react()], server: { port: 3000, proxy: { '/api': { target: 'http://127.0.0.1:8000', changeOrigin: true, }, }, }, } })