This project has moved and is read-only. For the latest updates, please go here.

Bundle Transformer: Handlebars

BundleTransformer.Handlebars contains translator-adapter HandlebarsTranslator (supports Handlebars version 4.0.10). This adapter makes translation of Handlebars-templates to JS-code. Also contains HTTP-handler HandlebarsAssetHandler, which is responsible for text output of translated Handlebars-asset.

Files whose names start with an underscore are compiled as the globally defined partials (first underscore are removed from the template name).

As a JS-engine is used the JavaScript Engine Switcher library. For correct working of this module is recommended to install one of the following NuGet packages: JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.ChakraCore. After package is installed and JS-engine is registered, need set a name of JavaScript engine (for example, MsieJsEngine) to the name attribute of /configuration/bundleTransformer/handlebars/jsEngine configuration element.

To use a debugging HTTP-handlers in the IIS Classic mode, you need add to the /configuration/system.web/httpHandlers element of the Web.config file a following code:

<add path="*.handlebars" verb="GET"
  type="BundleTransformer.Handlebars.HttpHandlers.HandlebarsAssetHandler, BundleTransformer.Handlebars" />
<add path="*.hbs" verb="GET"
  type="BundleTransformer.Handlebars.HttpHandlers.HandlebarsAssetHandler, BundleTransformer.Handlebars" />

Last edited May 21 at 7:25 PM by Taritsyn, version 14