webpack打包提示: The following entrypoint(s) combined asset size exceeds the recommended limit
webpack 打包时会出现:
出现这种现象的原因是因为 webpack 打包提示文件体积过大导致报错。
优化方案:
module.exports = { configureWebpack: config => { // 开发环境时生效 if (process.env.NODE_ENV === 'production') { config['performance'] = { // 警告 webpack 的性能提示 hints: 'warning', // 入口起点的最大体积 maxEntrypointSize: 50000000, // 生成文件的最大体积 maxAssetSize: 30000000, // 只给出 js 文件的性能提示 assetFilter: function (assetFilename) { return assetFilename.endsWith('.js') } } } } }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
码云笔记 » webpack打包提示: The following entrypoint(s) combined asset size exceeds the recommended limit
码云笔记 » webpack打包提示: The following entrypoint(s) combined asset size exceeds the recommended limit