3.1.3
no link
Node 8.9.4 / yarn 1.7.0 / Windows 10
1.设置多页面入口
2.编译开发环境
3.随便修改一个文件
编译速度瞬间完成
编译很慢,长达10几秒到30秒不等,有时更长
在vue cli 2中,我把html-webpack-plugin换成html-webpack-plugin-for-multihtml后,编译速度变成毫秒级,
https://github.com/jantimon/html-webpack-plugin/issues/724
是否考虑替换?或者是否有入口可以让使用者进行替换?
根据链接里的评论,html-webpack-plugin v4 应该已经修复了这个性能问题,如果你使用 yarn 的话,可以通过以下方法替换:
package.json 中加入"resolutions": {
"html-webpack-plugin": "^4.0.0-0"
}
vue.config.js 中禁用 preload / prefech 插件(它们不兼容新版的 html-webpack-plugin)module.exports = {
chainWebpack: config => {
config.plugins.delete('preload')
config.plugins.delete('prefetch')
}
}