can-compilify
CanJS template precompiler for Browserify.
Compiles CanJS Stache, Mustache and EJS templates into JavaScript using the very awesome can-compile.
Usage
Install can-compilify locally:
npm install can-compilify
Then require templates in your app:
var template = ;documentbodyinnerHTML = ;
And use can-compilify from the command line:
browserify -t can-compilify app.js > app.bundle.js
Or add it to your package.json:
Or programmatically:
var compilify = ;bundler;
can-compilify outputs a precompiled template with the require statements needed to render the template.
With template.stache:
{{greeting}} World!
The compipled template would be:
var can = ;;moduleexports = can;
Options
version
{String} the CanJS version to be used. Default is'2.2.4'
.
Also available as -v on the command line
paths
{Object} The paths to jQuery, CanJS and view plugins.jquery
{String} path to jquery.can
{String} path to can.ejs
{String} path to ejs.mustache
{String} path to mustache.stache
{String} path to stache.
requirePaths
{Object} The path for the require statements.can
{String} path to can. Default is'can'
.ejs
{String} path to ejs. Default is'can/view/ejs/ejs'
.mustache
{String} path to mustache. Default is'can/view/mustache/mustache'
.stache
{String} path to stache. Default is'can/view/stache/stache'
.
Programmatic usage
The configure
method of the transform can be used to create new transforms
with different defaults.
var compilify = ; var browserify = ;var b = ;b;b;
Changelog
0.1.1:
- Upgrading can-compile to 0.9.0
0.1.0:
- Initial release