combynify
combyne precompiler plugin for browserify.
features
- Optimizes templates into dependency-free isolated objects
- Recursively bundles all referenced filters, partials, and template inheritance
usage
installation
Install combynify
from npm, probably as a devDependency:
npm install --save-dev combynify
Use it as a browserify transform with -t
:
browerify -t combynify main.js > bundle.js
configure extensions
If you're planning on using an extension other than html
, you should
configure the extension
option using Browserify's configuration.
Set like:
browserify -t [ combynify --extension .tmpl ] index.js > dist/out.js
requiring
main.js can look something like this:
var template =console
hello.combyne
is a text file like this:
hello, {{ who }}
This is the equivalent of doing:
var template =console
so you can use all of combyne's fancy features like filters and partials:
var template =templatetemplateconsole