handlebarsify
Transform handlebars template for browserify. It's well tested, stable and fast.
Usage
Npm install first:
npm install handlebarsify handlebars
Then whip up a main.js
which require
a handlebars template tmp.handlebars
:
var tmpl = ;console
And tmpl.handlebars can be:
hello {{name}}.
CLI usage
Use -t
flag of browserify to use it:
browserify -t handlebarsify main.js > main.bundle.js
API usage
var handlebarsify = ;var browserify = ;var b = ; b;b;
Configure
use handlebarsify.create(options)
to get a configured transformer:
var handlebarsify = ; // ... b;
Support options
:
extensions
: handlebars file extension name list.[default: ['.handlebars', '.hbs']]
module
: module path which point tohandlebars
orhandlebars.runtime
.[default: 'handlebars/dist/cjs/handlebars.runtime']
- If
module
isnull
, handlebarsify will not require any handlebars module. This is useful when you have a globalHandlebars
in page.
Coming soon
- SourceMap
License
MIT