From 20afa904f1d42a8164a2d400ff5d667d39f4652d Mon Sep 17 00:00:00 2001 From: chear Date: Thu, 23 Jun 2022 07:40:16 +0000 Subject: [PATCH] =?UTF-8?q?update=20frontend/vue.config.js.=20=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=90=8E=E5=90=88=E5=B9=B6js=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=92=8Cadmin.net=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/vue.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 0bc1b0f..beb458a 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -35,12 +35,20 @@ const vueConfig = { plugins: [ // Ignore all locale files of moment.js new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + //maxChunks:使用大于或等于 1 的值,来限制 chunk 的最大数量。使用 1 防止添加任何其他额外的 chunk,这是因为entry/main chunk 也会包含在计数之中。 + //minChunkSize: 设置 chunk 的最小大小。 + //在合并 chunk 时,webpack 会尝试识别出具有重复模块的 chunk,并优先进行合并。任何模块都不会被合并到 entry chunk 中,以免影响初始页面加载时间。 + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 5, + minChunkSize: 100 + }), // 配置compression-webpack-plugin压缩 new CompressionWebpackPlugin({ algorithm: 'gzip', test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'), threshold: 10240, - minRatio: 0.8 + minRatio: 0.8, + deleteOriginalAssets: false // 是否删除源文件 默认为true 如果Nginx配置了gzip可以true,否则删了源文件就不能正常访问了 }) ], // if prod, add externals -- Gitee