修改vite配置

This commit is contained in:
2026-04-14 10:51:38 +08:00
parent d4ab6db42e
commit cf708dde75
23 changed files with 6 additions and 22 deletions

View File

@@ -5,11 +5,17 @@ export default defineConfig({
plugins: [react()],
server: {
port: 3000,
host: '0.0.0.0', // 监听所有网络接口
proxy: {
'/api': {
target: process.env.VITE_API_URL || 'http://localhost:33001',
changeOrigin: true,
},
},
hmr: {
host: 'performance-appraisal.excn.top', // 客户端访问的主机名
clientPort: 80, // nginx监听80端口外部代理将HTTPS 443转发到80
protocol: 'ws', // WebSocket协议nginx代理WebSocket
},
},
});