@nicolas 2021-04-27 16:43 采纳率: 66.7%
浏览 58

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相关的,请大神们帮帮忙~~

  • 写回答

2条回答 默认 最新

  • 卷腹肌肉侠 2021-04-27 16:59
    关注
    module.exports = {
        plugins: [
            new htmlWebpackPlugin()
        ]
    
    }

    试试这个呢。

    评论

报告相同问题?