broccoli-template-compiler

1.4.1 • Public • Published

broccoli-template-compiler

An opinionated filter for Broccoli that compiles handlebars templates for ember.js

Installation

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

Usage Example

module.exports = function (broccoli) {
  var templateCompiler = require('broccoli-template-compiler')
  var pickFiles = require('broccoli-static-compiler')

  function preprocess (tree) {
    tree = templateCompiler(tree);
    return tree
  }

  var sourceTree = broccoli.makeTree('js');
  var templates = pickFiles(sourceTree, {
    srcDir: '/templates',
    destDir: '/templates'
  })
  var appTemplates = preprocess(templates);
  return [appTemplates];
}

What file types does it work with?

It's opinionated so you get both .hbs and .handlebars extensions out of the box

What should I look out for?

It requires the destination directory name be templates (as shown in the above example)

Package Sidebar

Install

npm i broccoli-template-compiler

Weekly Downloads

1

Version

1.4.1

License

none

Last publish

Collaborators

  • toranb