Broccoli plugin that precompiles inline Handlebars templates so that libraries or applications can be packaged with Handlebars Runtime only instead of the full library.
inputTree
{Single Tree}
Input is a single tree.
In order for Broccoli Ember Inline Template Compiler to pickup inline templates, they must be assigned to a local variable called precompileTemplate
Example:
// instead of
var template = Ember.Handlebars.compile("...");
// do
var precompileTemplate = Ember.Handlebars.compile;
var template = precompileTemplate("...");
npm install --save-dev broccoli-ember-inline-template-compiler
And then in your Brocfile.js
:
var inlineTemplateCompiler = require('broccoli-ember-inline-template-compiler');
tree = inlineTemplateCompiler(tree);
npm install --save-dev broccoli-ember-inline-template-compiler
No changes to your Brocfile.js
Extracted from https://github.com/emberjs/ember.js/blob/master/lib/broccoli-ember-inline-template-precompiler.js. Authored by @rwjblue, @fivetanley, and @concreted.
This project is distributed under the MIT license.