mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-12-27 07:59:08 +08:00
Feat: manual chunks
Improve chunking by split chunks into several small chunks. It improves loading performance.
This commit is contained in:
parent
9d7ed246b9
commit
177697f906
@ -8,6 +8,41 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes("node_modules/ant-design-vue/es")) {
|
||||
return "ant-es";
|
||||
}
|
||||
if (id.includes("node_modules/ant-design-vue")) {
|
||||
return "ant";
|
||||
}
|
||||
if (id.includes("node_modules/echarts")) {
|
||||
return "echart";
|
||||
}
|
||||
if (id.includes("node_modules/zrender")) {
|
||||
return "zrender";
|
||||
}
|
||||
if (id.includes("node_modules/vue")||id.includes("node_modules/@vue")) {
|
||||
return "vue";
|
||||
}
|
||||
if (id.includes("node_modules/xterm")) {
|
||||
return "xterm";
|
||||
}
|
||||
if (id.includes("node_modules/@codemirror")) {
|
||||
return "codemirror";
|
||||
}
|
||||
if (id.includes("node_modules/monaco")) {
|
||||
return "monaco";
|
||||
}
|
||||
if (id.includes("languages")) {
|
||||
return "lang";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
"/api": {
|
||||
|
Loading…
Reference in New Issue
Block a user