Created
June 9, 2016 07:39
-
-
Save alexey-m-ukolov/499da282fb7716f90fb8640e50a860c1 to your computer and use it in GitHub Desktop.
Add pug/jade global helpers
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
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