Created
May 6, 2017 18:11
-
-
Save angeal185/9da684daf3b68aebae3d55ebca93e422 to your computer and use it in GitHub Desktop.
gulp task to minify .hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var htmlmin = require('gulp-htmlmin'); | |
gulp.task('minifyHbs', function() { | |
return gulp.src('dev/templates/**/*.hbs') | |
.pipe(htmlmin({ | |
collapseWhitespace: true, | |
removeComments: true, | |
removeCommentsFromCDATA: true, | |
removeComments: true, | |
minifyJS: true, | |
minifyCSS: true, | |
ignoreCustomFragments: [/{{[\s\S]*?}}/] | |
})) | |
.pipe(gulp.dest('./')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment