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

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

你可能感兴趣的:(Webpack06-html打包插件html-webpack-plugin的使用)