Skip to content

Simple and safety HTML/SVG cleaner to minify without changing its structure.

License

Notifications You must be signed in to change notification settings

anseki/gulp-htmlclean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.