Files
chuanqi-qycq-web/module/web/vite.config.js

37 lines
807 B
JavaScript
Raw Normal View History

2025-09-30 17:43:06 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from "node:path";
2025-09-30 17:43:06 +08:00
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
server: {
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
2026-03-16 12:05:55 +08:00
}
}
},
build: {
// 构建目标:现代浏览器
target: 'es2020',
// chunk 大小警告阈值kB
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
// 将大型依赖拆分为独立 chunk利用浏览器缓存
manualChunks: {
'vendor-vue': ['vue', 'vue-router'],
'vendor-element': ['element-plus'],
'vendor-axios': ['axios'],
}
}
}
}
})