Open tchapi opened 3 years ago
I am currently having the same issue. My blind guess is, that there is a breaking change between html-webpack-plugin
v4.4
and v4.5
. I am looking into it.
Hi @sagold
I think I found it. The culprit is process.cwd()
that introduces problems in the path for this specific feature. In fact, it changes the path where we expect the generated partial to be.
I'm doing this right now in the HtmlWebpackPlugin:
filename: path.join("dist", '_head.hbs')
and in the HandlebarsPlugin:
// ...
partials: [
path.join('html', '*', '*.hbs'), // No process.cwd() here also
path.join(process.cwd(), "assets", "components", "*.hbs")
],
// ...
... and it seems to work !
Maybe you could just update the example to reflect that ?
Best regards
Hello
webpack version: 4.44.2
I'm using this plugin along with html-webpack-plugin to generate a head partial before feeding it to Handlebars. I'm basically following https://github.com/sagold/handlebars-webpack-plugin#html-webpack-plugin exactly, but I have the following error:
My
index.hbs
template calls the partial with{{> html/_head }}
which I think is what it should be.My configuration is strictly what is proposed in the README:
Am I missing something ? It looks like HandlebarsPlugin is not being fed the files from the HtmlWebpackPlugin correctly. Thanks a lot for your suggestions !
Best regards