Files
bj_power/bj_power_dashboard/vite.config.ts
T

31 lines
752 B
TypeScript
Raw Normal View History

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
2026-08-27 19:50:57 +08:00
// MES(B) 内部 API 与 SSE 直连 :8888;其余 /api 走本地兜底服务 :3001
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
2026-08-27 19:50:57 +08:00
'/api/internal': {
target: 'http://localhost:8888',
changeOrigin: true,
},
'/sse': {
target: 'http://localhost:8888',
changeOrigin: true,
// SSE 长连接
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setHeader('X-Accel-Buffering', 'no');
});
},
},
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
});