Last Updated: February 25, 2016
·
1.13K
· jaketrent

Use Broccoli to Compile Emblem Templates for Ember

Install plugin

npm install --save-dev broccoli broccoli-merge-trees broccoli-static-compiler broccoli-ember-emblem

And setup Brocfile.js:

var emblem = require('broccoli-ember-emblem')
var mergeTrees = require('broccoli-merge-trees')
var pickFiles = require('broccoli-static-compiler')

function preprocess (tree) {
  tree = emblem(tree, {
    stripPathFromName: 'tmpl/'
  })
  return tree
}

var tmplTree = 'client/tmpl'
tmplTree = pickFiles(tmplTree, {
  srcDir: '/',
  destDir: '/tmpl'
})
tmplTree = preprocess(tmplTree)

module.exports = mergeTrees([ /* other trees, */ tmplTree ])

As seen at http://jaketrent.com/post/broccoli-ember-emblem/