component-build-handlebars
v0.0.1
Published
A component (v1+) builder plugin for Handlebars template precompilation
Downloads
17
Maintainers
Readme
component-build-handlebars
A component (v1.0.0+ only) builder plugin for Handlebars template pre-compilation.
Installation
npm i --save component-build-handlebars
Usage
NOTE: There are 2 places that require your attention. First, you
need to add the plugin to the builder. Second, you need to add the
Handlebars runtime to your build.js. (either that, or include it on
your page via another <script>
tag)
var handlebars = require("component-build-handlebars");
// ...
// add the plugin to the builder
builder.use("templates", handlebars({
// options for Handlebars.precompile here, but you usually don't need any
}));
// ...
// add the runtime to your build (it's an assumed global)
builder.scripts(function (err, js) {
// ...
write("build.js", handlebars.runtime + js);
});