From 7f69bc69bc344eaacd0f513b6b209a82afc5135e Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 13 Dec 2024 18:25:52 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=BC=96=E8=AF=91=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E6=8B=86=E5=8C=85manualChunks=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- vite.config.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 966f8eda..f4004deb 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@ant-design/icons-vue": "^7.0.1", "@antv/g6": "~4.8.24", "@codemirror/lang-javascript": "^6.2.2", - "@codemirror/lang-yaml": "^6.1.1", + "@codemirror/lang-yaml": "^6.1.2", "@codemirror/merge": "^6.7.4", "@codemirror/theme-one-dark": "^6.1.2", "@tato30/vue-pdf": "^1.11.3", diff --git a/vite.config.ts b/vite.config.ts index ac1af06f..d0c51d7d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,8 +55,12 @@ export default defineConfig(({ mode }) => { // 用于输出静态资源的块 assetFileNames: 'assets/[name].[hash].[ext]', manualChunks: id => { - if (id.indexOf('node_modules') !== -1) { - return 'vendor/index'; + if (id.includes('node_modules')) { + return id + .toString() + .split('node_modules/')[1] + .split('/')[0] + .toString(); } }, },