Gulp plugin for HTML minifiy.Based on minimize.
Thin wrapper over Swaagie's minimize.
Install package with NPM and add it to your development dependencies:
npm install gulp-minimize
var gulp = require('gulp');
var rename = require('gulp-rename');
var Minimize = require('gulp-minimize');
gulp.task('html', function() {
gulp.src('./index.html')
.pipe(Minimize())
.pipe(rename('min.html'))
.pipe(gulp.dest('.'));
});
Minimize({
empty:true,
cdata: true,
comments: false,
ssi: false,
conditionals: true,
spare: true,
quotes: true,
loose: true,
lowerCaseAttributeNames: false
})
See minimize for details and behavior for each option; the params are passed straight through.
MIT License (Expat)