A Mincer engine to for serving Ember-friendly Handlebars templates.
Note*: this engine overrides the built-in Handlebars engine. Furthermore, there is no need to pair your template files with the built-in JST engine. Naming your files
[my-template].hbs will do.
How to use this old thing
First, install the package:
npm install mincer-ember-hbs-engine --save
Then, wherever you've set up your Mincer environment:
// Requirements var mincer = require('mincer'); var mincerEmberHbs = require('mincer-ember-hbs-engine'); // Asset pipeline var pipeline = new mincer.Environment(); pipeline.registerEngine('.hbs', mincerEmberHbs);
Assuming a directory structure similar to this…
…you can now create a manifest for your templates, like this:
//= require_tree ./templates
But wait a second…
This engine never defines a default
Ember.TEMPLATES object like the JST engine does!
Not to fear, Ember handles defining
Ember.TEMPLATES as an empty object. Make sure that your templates aren't instantiated before Ember and you'll be A-OK.
What if I want to use JST templates at the same time?
At this time, the only way to achieve that would be to register this engine under a different file extension, leaving the default
.hbs engine intact.
Copyright (c) 2014 Mike Fowler
Released under the MIT license. See LICENSE for details.