Closed ethikz closed 7 years ago
You mention that you're using parsePartialName
, but I don't see it in the example you provided.
You're right! Sorry about that. I corrected the original comment to include it.
Cool. You're on the right track. Right now you're returning the full path as the partial name, when all you want is the basename. You can see the partial names your code generates by including the debug: true
flag to the hb config:
.pipe(hb({ debug: true })
You'll want to update your parsePartialName
method to only return the basename without extension:
const path = require('path');
// ...
.partials('./app/components/**/*.{hbs,js}', {
parsePartialName: function(options, file) {
return path.parse(file.path).name;
}
})
Ahh thanks! That was it! Thanks for your help
So I've been reading trying to find an answer which led me to here from
gulp-hb
.Issue I'm having is trying to extract path from component name. I am using
parsePartialName
like soThe issue I'm running into is I want to be able to include all sub-folders as well. Doing the above way I still have to type the folder in
components
folder.It would be better if I could glob the directory and just use
Is that possible or is it an issue with conflicts. If I have 2 different button directories I need to specify which one I'm going to use so the parser will know?