Ember template compiler middleware.
Features
- Render ember templates in node js as middleware
- Outputs AMD and
Ember.TEMPLATE
objects
Requires
What can I do with this?
To activate middleware require ember-template-compiler and then configure.
var compiler = require('ember-template-compiler');
A simple setup will look something like:
app.use(compiler.middleware({
src: __dirname + '/handlebars',
dest: __dirname,
format: 'AMD'
}));
src
: Hbs file folder. Do not include__dirname
if origin not defined, REQUIREDdest
: Output destination. Do not include__dirname
if origin not defined, REQUIREDorigin
: Origin directory, DEFAULT: falseforce
: Force compile, DEFAULT: falseformat
: Output format. Either'AMD'
ornull
.null
outputs anEmber.TEMPLATES
propertynamePrefix
: Prefix for template namepathInName
: Include path in name, DEFAULT: true
If the origin
is defined. src
and dest
will be relative to it.
app.use(compiler.middleware({
src: '/js/app/handlebars',
dest: '/js/app/templates',
origin: '/var/www/frontend/public',
namePrefix: 'app/templates',
format: 'AMD',
force: true
}));
License
Copyright © 2013 Jim Hall
Licensed under the MIT License