import { defineConfig, loadEnv } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '') const backendHost = env.VITE_BACKEND_HOST || 'localhost' const backendPort = env.VITE_BACKEND_PORT || '8443' const backendUrl = `https://${backendHost}:${backendPort}` return { plugins: [react(), tailwindcss()], server: { proxy: { '/api': { target: backendUrl, changeOrigin: true, secure: false, }, }, }, } })