Closed loremipson closed 8 years ago
You hit the nail on the head. Using the .partial()
method, etc, is recommended when globbing multiple directories.
Arrays work a little differently now due to a change to the require-glob
module. Files get a base path based on the non-globbed portion of the first pattern in a give array.
Excellent, thank you. I figured, but it isn't simple for me to try that out currently. I'm passing the values to hb()
via a project configuration file.. So I'll need to figure that out, but that's clearly on my end.
Thanks again.
I'll be addressing that issue when I incorporate this update into grunt-hb
. I'm planning to use a pattern like this:
{
partials: [
{
pattern: './something/**/*.hbs'
},
{
pattern: ['./something/**/*.hbs', '!**/layout.hbs'],
cwd: __dirname
}
]
}
Each option in the array would count as a call to the .partial()
method. It's a really awkward syntax which I why I don't plan to expose it here, and prefer to point people to the fluent api.
Thoughts?
I'm trying to upgrade from
2.6.5
to4.0.3
The
parsePartialName()
, etc. functions seem to be a little different. I've checked thehandlebars-wax
. I don't think thefile.exports
will work out well in my situation, so what I can do is run replacements onfile.path
:The problem here is that I'm passing an array as my hb partials, ie:
And only the partials in the first array index are having my "replacement" applied, rather than all of them.
Is the problem here that I'm passing an array? Should I now be using the
.partials('./something/**/*').partials('./somethingElse/**/*')
? Or should an array still be fine?