gulp-minifier
v3.5.0
Published
Minify HTML, JS, CSS with html-minifier, terser, clean-css.
Downloads
5,246
Readme
gulp-minifier
Minify HTML, JS, CSS with html-minifier, terser, clean-css.
For example:
var minify = require('gulp-minifier');
gulp.task('example', function() {
return gulp.src('example/src/**/*').pipe(minify({
minify: true,
minifyHTML: {
collapseWhitespace: true,
conservativeCollapse: true,
},
minifyJS: {
sourceMap: true
},
minifyCSS: true,
getKeptComment: function (content, filePath) {
var m = content.match(/\/\*![\s\S]*?\*\//img);
return m && m.join('\n') + '\n' || '';
}
})).pipe(gulp.dest('example/dest'));
});