import { defineApplicationConfig } from '@vben/vite-config';
export default defineApplicationConfig({
overrides: {
optimizeDeps: {
include: [
'echarts/core',
'echarts/charts',
'echarts/components',
'echarts/renderers',
'qrcode',
'@iconify/iconify',
'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US',
],
},
server: {
proxy: {
'/basic-api': {
target: 'http://192.168.32.2:8001', // 假设这是你的内网API服务器地址
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/basic-api/, '/api'), // 假设你的内网API路径以/api开始
},
'/ws-api': {
target: 'ws://192.168.8.96:1880', // WebSocket服务的内网地址
ws: true, // 启用WebSocket代理
changeOrigin: true, // 为WebSocket连接改变origin
rewrite: (path) => path.replace(/^\/ws-api/, '/ws/ai'),
},
'/api': {
target: 'http://localhost:3000', // 假设这是你的本地开发服务器地址
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/api/, ''), // 删除/api前缀
},
'/upload': {
target: 'http://localhost:3300', // 假设这是你的上传服务地址
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/upload/, ''), // 删除/upload前缀
},
},
warmup: {
clientFiles: ['./index.html', './src/{views,components}/*'],
},
},
},
});
评论