Hi,
This is my configuration for handlebars helpers:
{
test: /\.hbs$/,
use: [
{
loader: 'handlebars-loader',
options: {
precompileOptions: {
knownHelpersOnly: false,
},
helperDirs: path.resolve(__dirname, './src/component/hbs/helpers'),
}
}
]
}
helper.js
function addYear(s) {
return s + ' ' + new Date().getFullYear();
}
module.exports = addYear;
hbs file
{{ addYear '@' }}
and I keep getting this error whenever I run build:
ERROR in Template execution failed: Error: Missing helper: "addYear"
ERROR in Error: Missing helper: "addYear"
Hi,
This is my configuration for handlebars helpers:
helper.js
hbs file
{{ addYear '@' }}and I keep getting this error whenever I run build: