webpack 打出来的 chunk.js 数量多,影响加载速度,合并配置一下即可
const webpack = require('webpack') module.exports = { chainWebpack: config => { config.plugin('chunkPlugin').use(webpack.optimize.LimitChunkCountPlugin,[{ maxChunks:5, // 必须大于或等于 1 minChunkSize: 10000 }]) } }
官方文档地址: https://www.w3cschool.cn/doc_webpack/webpack-plugins-limit-chunk-count-plugin.html