Search code examples
javascriptgruntjshandlebars.jsbrowserify

How can I compile a javascript library for the browser?


I would like to use a library (handlebars-helpers) in the browser. I tried following the instructions for that, but hey don't seem to work.

Most importantly though I'd like to know what I am doing, and not only copy-paste, also because the same problem will probably pop up again when I try using handlebars-intl.

What should I google for, in order to find a basic tutorial on what's supposed to go on under the hood here? It it browserify?


Solution

  • I think you can use hbsfy.

    It compiles Handlebars templates to plain Javascript. The compiled templates only have one copy of the Handlebars runtime so they are lightweight and fast!

    Please go through https://www.npmjs.com/package/hbsfy for more details.