Skip to content

Instantly share code, notes, and snippets.

@alexey-m-ukolov
Created June 9, 2016 07:39
Show Gist options
  • Save alexey-m-ukolov/499da282fb7716f90fb8640e50a860c1 to your computer and use it in GitHub Desktop.
Save alexey-m-ukolov/499da282fb7716f90fb8640e50a860c1 to your computer and use it in GitHub Desktop.
Add pug/jade global helpers
gulp.task('pug', function () {
global._ = require('lodash');
global.helpers = require('./' + paths.src.root + '/pug-helpers');
global.mocks = require('./' + paths.dest.root + '/mocks.json');
return gulp.src(paths.src.html + '/**/!(_)*.pug')
.pipe(plumber())
.pipe(pug({
doctype: 'html',
pretty: true,
globals: ['_', 'helpers', 'mocks'],
}))
.pipe(gulp.dest(paths.dest.html));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment