Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.52 KB

README.md

File metadata and controls

39 lines (27 loc) · 1.52 KB

gulp-htmlclean

npm GitHub issues David license

This gulp plugin is wrapper of htmlclean.

If you want to just clean files, Command Line Tool is easy way.

Simple and safety HTML/SVG cleaner to minify without changing its structure.
See htmlclean for options and more information about htmlclean.

Getting Started

npm install gulp-htmlclean --save-dev

Usage

gulpfile.js

var gulp = require('gulp'),
  htmlclean = require('gulp-htmlclean');

gulp.task('default', function() {
  return gulp.src('./develop/*.html')
    .pipe(htmlclean({
        protect: /<\!--%fooTemplate\b.*?%-->/g,
        edit: function(html) { return html.replace(/\begg(s?)\b/ig, 'omelet$1'); }
      }))
    .pipe(gulp.dest('./public_html/'));
});

See htmlclean for the options.