TypeError: Class constructor HtmlWebpackPlugin cannot be invoked without 'new'

const path = require('path')
// 1.导入插件,得到构造函数
const HtmlPlugin = require('html-webpack-plugin')
// 2.创建插件的实例对象
const htmlPlugin = new HtmlPlugin({
    template: './src/index.html',
    filename: './index.html'
})
module.exports = {
    mode: 'development', // development  production
    // 指定打包的入口
    entry: path.join(__dirname, './src/index.js'),
    // 指定打包的出口
    output: {
        // 表示输出文件的存放路径
        path: path.join(__dirname, './dist'),
        // 表示输出文件的名称
        filename: 'bundle.js',
    },
    plugins: [HtmlPlugin]  //3.挂载插件的实例对象
}

img

各位,帮帮忙,看看怎么处理?

挂载插件的实例对象的H改成h:

plugins: [htmlPlugin]