Files
chuanqi-qycq-web/module/web/vite.config.js
艾贤凌 6d4a72161f inint
2026-03-16 12:05:55 +08:00

37 lines
807 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from "node:path";
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
server: {
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
}
}
},
build: {
// 构建目标:现代浏览器
target: 'es2020',
// chunk 大小警告阈值kB
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
// 将大型依赖拆分为独立 chunk利用浏览器缓存
manualChunks: {
'vendor-vue': ['vue', 'vue-router'],
'vendor-element': ['element-plus'],
'vendor-axios': ['axios'],
}
}
}
}
})