Handlebars custom helper - migrating to Webpack
Handlebars custom helper - migrating to Webpack We have an app based on backbone, marionette and handlebars, without import/export or require methods, managed with grunt and we are trying to migrate to webpack. I am having an issue with a custom helper for handlebars. The code of our helper : 'use strict'; function I18n() { this.constructor(arguments); } I18n.prototype = { constructor: function () { ...some stuff } get: function () { ...some stuff } ...some other functions } ourNameSpace.I18n = new I18n(); And it's included with this function in a file to load it globally : Handlebars.registerHelper('i18n', _.bind(ourNameSpace.I18n.get, ourNameSpace.I18n)); Then we are using it in the template like this : {{i18n "LblEmail"}} I tried to use handlebars-loader and I added this query object into webpack.config to add it to the bundle : { test: /.hbs$/, use: { loader: 'handlebars-loader', q...