webpack笔记(2)打包src下的html文件

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'
        }),
    ]
}

 

posted @ 2018-07-12 16:22  Zero||One  阅读(362)  评论(0编辑  收藏  举报