html-webpack-plugin自动生成html页面运行报错如下:

node+webpack打包构建(1)

解决方案:

    由于我在webpack.config.js中导入html-webpack-plugin这个模块,然后在plugins属性身上创建一个html-webpack-plugin的实例;但是本地没有安装这个插件。

    安装html-webpack-plugin插件:npm i html-webpack-plugin -D

webpack.config.js配置如下:

node+webpack打包构建(1)

相关文章: