bartsqueezy/ember-handlebars-brunch — pull request #14 by jas (2013-11-26 18:59:23+00:00)
Title: Add wrapping for AMD modules

This allows use of https://github.com/stefanpenner/ember-jj-abrams-resolver which can load templates from AMD modules instead of `Ember.TEMPLATES`

When `modules.wrapper` is set to `"amd"`, Brunch handles adding the module name to the `define` wrapper function.

Example output after being processed through Brunch. `modules.nameCleaner` option can be used to remove `app/` module prefix.

```js
define("app/templates/index", [], function() {
return Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
data.buffer.push("

Hello, world!

\n");
});
});
```

This could be cleaner if we replace `modulePrefix` with the `wrapper` function, but I left it for backwards compatibility in case anyone is overriding it.