22 lines
603 B
TypeScript
22 lines
603 B
TypeScript
import { defineConfig } from 'vite';
|
||
import react from '@vitejs/plugin-react';
|
||
|
||
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
|
||
},
|
||
},
|
||
});
|