Files
张翔 9e635b1483 chore: 配置与基础设施更新
- 开发服务器端口从 3002 改为 5174
- vitest 配置从 vue plugin 改为 react plugin
- playwright 新增 uat 项目配置,修正 baseURL
- 添加 less 依赖支持
- 修复各页面 catch 块空语句为注释标记
2026-05-06 19:43:39 +08:00

49 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
server: {
port: 5174,
host: '0.0.0.0',
strictPort: true,
proxy: {
'/api': {
target: process.env.VITE_API_TARGET || 'http://localhost:8080',
changeOrigin: true,
secure: false
}
},
hmr: { overlay: false },
cors: true
},
build: {
target: 'esnext',
minify: 'terser',
terserOptions: {
compress: { drop_console: true, drop_debugger: true }
},
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router'],
'antd': ['antd'],
'antv': ['@antv/g2', '@antv/g6', '@antv/l7', '@antv/s2'],
'utils': ['axios', 'date-fns']
}
}
},
chunkSizeWarningLimit: 1000,
reportCompressedSize: false
},
optimizeDeps: {
include: ['react', 'react-dom', 'react-router', 'zustand', 'antd', 'axios']
}
})