Skip to content

Instantly share code, notes, and snippets.

@dbugshe2
Created September 2, 2021 22:47
Show Gist options
  • Save dbugshe2/a440474bbd1a9fa3aa570bdd9ebf8561 to your computer and use it in GitHub Desktop.
Save dbugshe2/a440474bbd1a9fa3aa570bdd9ebf8561 to your computer and use it in GitHub Desktop.
Use Gulp to complie handlebars
// gulpfile.js
const handlebars = require('gulp-compile-handlebars');
const rename = require('gulp-rename');
gulp.task('html', () => {
return gulp.src('./src/pages/*.hbs')
.pipe(handlebars({}, {
ignorePartials: true,
batch: ['./src/partials']
}))
.pipe(rename({
extname: '.html'
}))
.pipe(gulp.dest('./dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment