Closed thecreation closed 8 years ago
You need to specify the file
flag which is now false
by default.
gulp.src('...')
.pipe(hb({
file: true
}))
.pipe(gulp.dest('...'))
@amazingSurge You inspired a change. I dropped the { file: true }
flag and added a @file
property. In your example you'll access it like this:
Handlebars.registerHelper("file", function(options) {
var file = options.data.file;
return file.path;
});
In a template you'd access it like this (which does the same thing as your helper):
{{@file.path}}
Release pending completion of CI tests.
Released as v5.0.0.
https://github.com/shannonmoeller/gulp-hb/tree/v5.0.0#-data-variables
Thank you! It works.
Hi there,
In the v2.6.5, we can use options.data.root.file to access the file object on helper register callaback. But in the new versions, it throw a error that file is not undefined.