webpack4: compilation.mainTemplate.applyPluginsWaterfall is not a function 解决方法

时间:2018-02-26 21:48:21   收藏:0   阅读:2814

今天捣鼓webpack4踩到一个弥天大坑:使用html-webpack-plugin打包html的时候一直报 compilation.mainTemplate.applyPluginsWaterfall is not a function ,百度了半天没结果,谷歌一下终于在github上找到了解决方案:https://github.com/jantimon/html-webpack-plugin/issues/841

解决:先安装yarn,然后在项目跟目录下运行:

yarn add webpack-contrib/html-webpack-plugin -D

简单来说就是使用webpack官方维护的html-webpack-plugin来代替第三方的。

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!