import { fileURLToPath, URL } from 'node:url' import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '') return { plugins: [vue()], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }, server: { proxy: { '^/api': { target: env.VITE_API_URL || 'http://localhost:5000', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } }, watch: { usePolling: true, ignored: ['**/node_modules/**', '**/dist/**'], }, host: '0.0.0.0', } } })