Skip to content

Instantly share code, notes, and snippets.

@aarongustafson
Last active September 21, 2016 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarongustafson/67f9c42404133548f807864382b3ab82 to your computer and use it in GitHub Desktop.
Save aarongustafson/67f9c42404133548f807864382b3ab82 to your computer and use it in GitHub Desktop.
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