webpack:The ‘compilation‘ argument must be an instance of Compilation

在webpack配置html文件打包时出现如下错误在这里插入图片描述
原因:
我的webpack的版本用的5.0的版本,然后与html-webpack-plugin 插件不兼容
解决方法:
安装4.0及以上的wepback和对应的HtmlWebpackPlugin
npm install [email protected] -g
npm i html-webpack-plugin -D

Guess you like

Origin blog.csdn.net/fankse/article/details/109802129