HtmlWebpackPlugin打包报错
来源:3-5 使用 plugins 让打包更便捷
 
			水荷
2021-03-25
不用这个插件是可以打包的,用了就报错。
webpack.config.js代码如下:
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    mode: "development",
    entry: "./index.js",
    plugins: [new HtmlWebpackPlugin()],
    output:{
        filename: "index.js"
    }
}
package.json代码如下:
{
  "name": "test-webpack",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "bundle": "webpack"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "html-webpack-plugin": "^5.3.1",
    "webpack-cli": "^3.3.12"
  },
  "dependencies": {
    "webpack": "^4.46.0"
  },
  "description": ""
}
/Users/shiminghui/Desktop/my/code/testWebpack/node_modules/webpack-cli/bin/cli.js:281
throw err;
TypeError: Cannot read property ‘tap’ of undefined
写回答
	1回答
- 
				  Dell 2021-03-26 重新安装一次依赖 022021-03-27
相似问题
