@@ -76,64 +76,64 @@ export default defineConfig(({ envMode }) => {
|
|||||||
performance: {
|
performance: {
|
||||||
chunkSplit: {
|
chunkSplit: {
|
||||||
strategy: "split-by-module",
|
strategy: "split-by-module",
|
||||||
override: {
|
// override: {
|
||||||
cacheGroups: {
|
// cacheGroups: {
|
||||||
// ===== 核心框架层 (100+) =====
|
// // ===== 核心框架层 (100+) =====
|
||||||
// Vue 生态 - 框架基础,最高优先级
|
// // Vue 生态 - 框架基础,最高优先级
|
||||||
vue: {
|
// vue: {
|
||||||
test: /[\\/]node_modules[\\/](vue|vue-router|pinia|@vue|@vueuse)[\\/]/,
|
// test: /[\\/]node_modules[\\/](vue|vue-router|pinia|@vue|@vueuse)[\\/]/,
|
||||||
name: "vendor-vue",
|
// name: "vendor-vue",
|
||||||
priority: 100,
|
// priority: 100,
|
||||||
},
|
// },
|
||||||
// ===== UI 层 (90+) =====
|
// // ===== UI 层 (90+) =====
|
||||||
// Naive UI 及其依赖 - 核心 UI 框架
|
// // Naive UI 及其依赖 - 核心 UI 框架
|
||||||
ui: {
|
// ui: {
|
||||||
test: /[\\/]node_modules[\\/](naive-ui|@css-render|css-render|seemly|vooks|vueuc|treemate|vdirs|evtd)[\\/]/,
|
// test: /[\\/]node_modules[\\/](naive-ui|@css-render|css-render|seemly|vooks|vueuc|treemate|vdirs|evtd)[\\/]/,
|
||||||
name: "vendor-ui",
|
// name: "vendor-ui",
|
||||||
priority: 90,
|
// priority: 90,
|
||||||
},
|
// },
|
||||||
// ===== 编辑器层 (70-80) =====
|
// // ===== 编辑器层 (70-80) =====
|
||||||
// CodeMirror - 代码编辑器(使用最频繁)
|
// // CodeMirror - 代码编辑器(使用最频繁)
|
||||||
editor: {
|
// editor: {
|
||||||
test: /[\\/]node_modules[\\/](codemirror|@codemirror|vue-codemirror|y-codemirror\.next)[\\/]/,
|
// test: /[\\/]node_modules[\\/](codemirror|@codemirror|vue-codemirror|y-codemirror\.next)[\\/]/,
|
||||||
name: "vendor-editor",
|
// name: "vendor-editor",
|
||||||
priority: 80,
|
// priority: 80,
|
||||||
},
|
// },
|
||||||
// Markdown 编辑器
|
// // Markdown 编辑器
|
||||||
mdeditor: {
|
// mdeditor: {
|
||||||
test: /[\\/]node_modules[\\/]md-editor-v3[\\/]/,
|
// test: /[\\/]node_modules[\\/]md-editor-v3[\\/]/,
|
||||||
name: "vendor-mdeditor",
|
// name: "vendor-mdeditor",
|
||||||
priority: 75,
|
// priority: 75,
|
||||||
},
|
// },
|
||||||
// WangEditor - 富文本编辑器
|
// // WangEditor - 富文本编辑器
|
||||||
wangeditor: {
|
// wangeditor: {
|
||||||
test: /[\\/]node_modules[\\/]@wangeditor-next[\\/]/,
|
// test: /[\\/]node_modules[\\/]@wangeditor-next[\\/]/,
|
||||||
name: "vendor-wangeditor",
|
// name: "vendor-wangeditor",
|
||||||
priority: 70,
|
// priority: 70,
|
||||||
},
|
// },
|
||||||
// ===== 功能库层 (50-60) =====
|
// // ===== 功能库层 (50-60) =====
|
||||||
// Chart.js - 图表库(按需加载)
|
// // Chart.js - 图表库(按需加载)
|
||||||
charts: {
|
// charts: {
|
||||||
test: /[\\/]node_modules[\\/](chart\.js|vue-chartjs|@kurkle|canvas-confetti)[\\/]/,
|
// test: /[\\/]node_modules[\\/](chart\.js|vue-chartjs|@kurkle|canvas-confetti)[\\/]/,
|
||||||
name: "vendor-charts",
|
// name: "vendor-charts",
|
||||||
priority: 60,
|
// priority: 60,
|
||||||
},
|
// },
|
||||||
// Mermaid - 流程图库(按需加载)
|
// // Mermaid - 流程图库(按需加载)
|
||||||
mermaid: {
|
// mermaid: {
|
||||||
test: /[\\/]node_modules[\\/]mermaid[\\/]/,
|
// test: /[\\/]node_modules[\\/]mermaid[\\/]/,
|
||||||
name: "vendor-mermaid",
|
// name: "vendor-mermaid",
|
||||||
priority: 55,
|
// priority: 55,
|
||||||
},
|
// },
|
||||||
// ===== 通用层 (10) =====
|
// // ===== 通用层 (10) =====
|
||||||
// 其他常用库 - 兜底分组
|
// // 其他常用库 - 兜底分组
|
||||||
common: {
|
// common: {
|
||||||
test: /[\\/]node_modules[\\/]/,
|
// test: /[\\/]node_modules[\\/]/,
|
||||||
name: "vendor-common",
|
// name: "vendor-common",
|
||||||
priority: 10,
|
// priority: 10,
|
||||||
minChunks: 2,
|
// minChunks: 2,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
removeConsole: ["log"],
|
removeConsole: ["log"],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user