gulp 插件

gulp 常用插件:

1. gulp-less

2. gulp-htmlmin

  • 说明:压缩html,可以压缩页面javascript、css,去除页面空格、注释,删除多余属性等操作;
  • github:[https://github.com/jonschlinkert/gulp-htmlmin][2]
    
    var gulp = require('gulp'),
      htmlmin = require('gulp-htmlmin');

gulp.task('testHtmlmin', function () {
var options = {
removeComments: true,//清除HTML注释
collapseWhitespace: true,//压缩HTML
collapseBooleanAttributes: true,//省略布尔属性的值 ==>
removeEmptyAttributes: true,//删除所有空格作属性值 ==>
removeScriptTypeAttributes: true,//删除