From 302bc7d955a5bf5a7bbc80212f25089ee5e04c96 Mon Sep 17 00:00:00 2001 From: xiangshu233 Date: Tue, 5 Mar 2024 23:01:23 +0800 Subject: [PATCH] =?UTF-8?q?build:=20:package:=20chunk=20=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index a159edc..407f65c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -100,14 +100,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { chunkSizeWarningLimit: 2000, // 自定义底层的 Rollup 打包配置 rollupOptions: { - // 静态资源分类打包 + // 静态资源分类打包 output: { chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称 entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称 assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等 // 将 node_modules 三方依赖包最小化拆分 manualChunks(id) { - if (id.includes('node_modules') && !id.includes('@antv')) { + if (id.includes('node_modules')) { const paths = id.toString().split('node_modules/') if (paths[2]) { return paths[2].split('/')[0].toString()