Webpack06 html打包插件html webpack plugin的使用

233 阅读1分钟

1、安装

在webpack4之前,默认集成该插件,无需安装 在webpack4之后,需要独立安装

npm install html-webpack-plugin --s -d

2、配置

    plugins: [ 
        new htmlPlugin({
            minify: {
                removeAttributeQuotes: true
            },
            hash: true,
            template: './src/index.html'
        })
    ],

image.png