Last active
September 21, 2016 17:22
-
-
Save aarongustafson/67f9c42404133548f807864382b3ab82 to your computer and use it in GitHub Desktop.
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'), | |
htmlmin = require('gulp-htmlmin'), | |
rename = require('gulp-rename'), | |
notify = require('gulp-notify'), | |
mustache = require('gulp-mustache'), | |
mustache_vars = require('../../source/data/mustache_vars.json'); | |
gulp.task('html', function() { | |
var source = './source/templates/*.mustache', | |
destination = './deploy', | |
htmlmin_config = { | |
removeComments: true, | |
collapseWhitespace: true | |
}; | |
return gulp.src(source) | |
.pipe(mustache(mustache_vars,{},{})) | |
.pipe(htmlmin(htmlmin_config)) | |
.pipe(rename({extname: '.html'})) | |
.pipe(gulp.dest(destination)) | |
.pipe(notify({ message: 'HTML built & minified' })); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment