handlebars.js - How to get gulp-handlebars to recognize partials -
i having trouble getting handlebars locate partials. have nested folder structure looks following:
some/local/path/handlebars/shared/_shared.hbs some/local/path/handlebars/nested/template1.hbs some/local/path/handlebars/nested/template2.hbs
i thought default handlebars supposed mark files start underscore partial, i'm not seeing calls "registerpartials" in output. below last modification i've made gulp task. can't seem figure out how debug - maybe i've been staring @ 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 set this:
some/local/path/handlebars/**/*.hbs
any idea i'm doing wrong here? also, out of curiosity (and maybe part of problem), there purpose processname outside of generating namespace?
thanks in advance help!
Comments
Post a Comment