zoukankan      html  css  js  c++  java
  • gulp-htmlmin 页面压缩插件 gulp插件 参数说明

    gulpfile.js

    var gulp = require('gulp'),
        htmlmin = require('gulp-htmlmin');
     
    gulp.task('testHtmlmin', function () {
        var options = {
            removeComments: true,//清除HTML注释
            collapseWhitespace: true,//压缩HTML
            collapseBooleanAttributes: true,//省略布尔属性的值 <input checked="true"/> ==> <input />
            removeEmptyAttributes: true,//删除所有空格作属性值 <input id="" /> ==> <input />
            removeScriptTypeAttributes: true,//删除<script>的type="text/javascript"
            removeStyleLinkTypeAttributes: true,//删除<style>和<link>的type="text/css"
            minifyJS: true,//压缩页面JS
            minifyCSS: true//压缩页面CSS
        };
        gulp.src('src/html/*.html')
            .pipe(htmlmin(options))
            .pipe(gulp.dest('dist/html'));
    });
  • 相关阅读:
    Word pair Hu
    [bzoj1601] 灌水
    小木棍
    雇佣计划
    [Luogu1282] 多米诺骨牌
    [Luogu1216] 数字三角形
    [Luogu1734] 最大约数和
    [NOIp2008] 传纸条
    [Luogu1325] 雷达安装
    nginx
  • 原文地址:https://www.cnblogs.com/liujinyu/p/5583931.html
Copyright © 2011-2022 走看看