0.0.1 • Published 10 years ago

broccoli-ember-inline-template-compiler v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Broccoli Ember Inline Template Compiler

Broccoli plugin that precompiles inline Handlebars templates so that libraries or applications can be packaged with Handlebars Runtime only instead of the full library.

Documentation

inlineTemplateCompiler(inputTree)

inputTree {Single Tree}

Input is a single tree.

Usage

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("...");

Installation (as Broccoli plugin)

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);

Installation (as ember-cli addon)

npm install --save-dev broccoli-ember-inline-template-compiler

No changes to your Brocfile.js

Credits

Extracted from https://github.com/emberjs/ember.js/blob/master/lib/broccoli-ember-inline-template-precompiler.js. Authored by @rwjblue, @fivetanley, and @concreted.

License

This project is distributed under the MIT license.