npm安装:
//安装依赖 npm install --save-dev html-webpack-plugin;
webpack.config.js中配置
const htmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { plugins:[ new htmlWebpackPlugin({ minify:{ removeAttributeQuotes : true }, hash:true, template : './src/index.html' }), ] }