I am having trouble getting handlebars to locate my partials. I have a nested folder structure that looks like the following:
some/local/path/handlebars/shared/_shared.hbs
some/local/path/handlebars/nested/template1.hbs
some/local/path/handlebars/nested/template2.hbs
I thought that by default handlebars is supposed to mark all files that start with an underscore as a partial, but I'm not seeing any calls to "registerPartials" in the output. Below is the last modification I've made to my gulp task. I can't seem to figure out how to debug this - maybe I've been staring at it for too long.
gulp.task('template', function() {
return gulp.src(paths.templates)
.pipe(handlebars())
.pipe(wrap('Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'myapp.templates',
noRedeclare: true,
processName: function(filePath) {
return someFunction(filePath);
}
}))
.pipe(concat('templates.js'))
.pipe(gulp.dest('output/path'));
});
My paths.templates variable is set to this:
some/local/path/handlebars/**/*.hbs
Any idea what I'm doing wrong here? Also, just out of curiosity (and maybe this is part of my problem), but is there another purpose for processName outside of generating the namespace?
Thanks in advance for any help!