码迷,mamicode.com
首页 > Web开发 > 详细

webpack.config.js====插件html-webpack-plugin

时间:2019-01-20 20:05:42      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:min   ace   lap   dex   设置   pack   ini   col   nbsp   

1. 安装

cnpm install html-webpack-plugin --save-dev

2. webpack.config.js中使用

const htmlWebpackPlugin = require(html-webpack-plugin);
    //插件配置
    plugins: [
        new htmlWebpackPlugin({
            template: ./src/index.html,
            //hash主要是清除缓存用
            hash: true,
            //开发期间可以不用设置,主要是方便查看生成的文件
            //             minify:{
            //                 removeAttributeQuotes:true,//去除引号
            //                 collapseWhitespace:true, //html压缩为一行
            //             }
        }),

    ],

 

webpack.config.js====插件html-webpack-plugin

标签:min   ace   lap   dex   设置   pack   ini   col   nbsp   

原文地址:https://www.cnblogs.com/songxia/p/10295765.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!