webpack打包配置htmlwebpackplugin时报错

webpack打包时报错:TypeError: Cannot read property 'initialize' of undefined

配置webpack.config.js如下:

const path = require('path')

 

const webpack = require('webpack')

const htmlWebpackPlugin = require("html-webpack-plugin")

  plugins: [

    new htmlWebpackPlugin()

  ]

上面是配置htmlwebpackplugin。在网上查到了很多类似错误,但是唯一没有和initialize相关的,请大神们帮帮忙~~

module.exports = {
    plugins: [
        new htmlWebpackPlugin()
    ]

}

试试这个呢。

贴一下配置