jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

Is there a way to minify the actual HTML file? #191

Closed antonmaximus closed 8 years ago

antonmaximus commented 8 years ago

I understand that I can minify the css and js files. However, how do I minify the HTML file itself via gulp-useref?

jonkemp commented 8 years ago

Something like this maybe?

gulp.task('html', function () {
    return gulp.src('app/*.html')
        .pipe(useref())
        .pipe(gulpif('*.html', minifyHTML()))
        .pipe(gulp.dest('dist'));
});
1mike12 commented 6 years ago

dank