-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
31 lines (25 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
var path = require('path');
var checker = require('ember-cli-version-checker');
var EmberPreprocessor = require('./lib/coffee-preprocessor');
module.exports = {
name: 'Ember CLI Emberscript Addon',
shouldSetupRegistryInIncluded: function() {
return !checker.isAbove(this, '0.2.0');
},
blueprintsPath: function() {
return path.join(__dirname, 'blueprints');
},
setupPreprocessorRegistry: function(type, registry) {
// FIXME: since this is being called before included(), what's a safe way to get the app's config?
// See https://github.com/kimroen/ember-cli-coffeescript/issues/98
var plugin = new EmberPreprocessor({});
registry.add('js', plugin);
},
included: function(app) {
this.app = app;
if (this.shouldSetupRegistryInIncluded()) {
this.setupPreprocessorRegistry('parent', app.registry);
}
}
};