import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' const backend = process.env.VITE_BACKEND_URL || 'http://localhost:8080' // When the workspace is served through the HTTPS proxy, HMR must connect to // the proxy port instead of the Vite port. const hmrClientPort = process.env.VITE_HMR_CLIENT_PORT ? Number(process.env.VITE_HMR_CLIENT_PORT) : undefined export default defineConfig({ plugins: [vue()], server: { host: '0.0.0.0', port: 5173, // The workspace is reachable through a per-user proxy domain such as // 5174--main--zjx-code--zhangjianxue.code.connectconcur.com. allowedHosts: ['.code.connectconcur.com'], hmr: hmrClientPort ? { clientPort: hmrClientPort } : undefined, proxy: { '/api': { target: backend, changeOrigin: true }, '/open': { target: backend, changeOrigin: true } } } })