Hey there,
I've got 3 different .mustache files (index.mustache, work.mustache and about.mustache) and I'm trying to pass different variables to those 3 entries from my webpack.common.js. (Let's say I want my title to change and say Hello Index in Index, Hello About in About and Hello Work in Work, for example).
For this, this is my typical folder stucture:
{
test: /\.mustache$/,
loader: 'mustache-loader',
options: {
tiny: true,
//I want this part to be used differently for each page
render: {
title: 'hello Index',
},
},
}
I know I could write as many rules as number of mustache pages I have, but I'm wondering whether data can be passed to the template through each HtmlWebpackPlugin declaration, instead of through the rule.
Hey there, I've got 3 different .mustache files (index.mustache, work.mustache and about.mustache) and I'm trying to pass different variables to those 3 entries from my webpack.common.js. (Let's say I want my title to change and say Hello Index in Index, Hello About in About and Hello Work in Work, for example). For this, this is my typical folder stucture:
I've got the same lines in both index, about and work .mustache:
and here's my webpack.common.js
Please pay attention to this part:
I know I could write as many rules as number of mustache pages I have, but I'm wondering whether data can be passed to the template through each HtmlWebpackPlugin declaration, instead of through the rule.
Thank in advance 👌🏽