I'm using this handlebars-loader for webpack 4. Now I wanted to use a custom helper, but i only get this error
ERROR in Template execution failed: TypeError: __default(...).call is not a function
ERROR in TypeError: __default(...).call is not a function
this is my webpack.config
//handlebars-loader
{
test: /\.(hbs)$/,
loader: "handlebars-loader",
options: {
helperDirs: [path.join(__dirname, './src/hbs/helpers')],
partialDirs: [path.join(__dirname, './src/hbs/partials')]
},
}
and this is my simple helper
const Handlebars = require('handlebars');
Handlebars.registerHelper('repeat', function(n) {
console.log(n);
});
and how I use it
{{#repeat 10}}
<span> repeat</span>
{{/repeat}}
Does anyone know what I'm doing wrong?