forked from kimroen/ember-cli-coffeescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (28 loc) · 918 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
32
33
34
35
36
'use strict';
var path = require('path');
var checker = require('ember-cli-version-checker');
var defaults = require('lodash').defaults;
var TypeScriptPreprocessor = require('./lib/typescript-preprocessor');
module.exports = {
name: 'Ember CLI TypeScript Addon',
shouldSetupRegistryInIncluded: function() {
return !checker.isAbove(this, '0.2.0');
},
getConfig: function() {
var brocfileConfig = {};
var typeScriptOptions = defaults(this.project.config(process.env.EMBER_ENV).typeScriptOptions || {},
brocfileConfig, {
blueprints: true
});
return typeScriptOptions;
},
blueprintsPath: function() {
if (this.getConfig().blueprints) {
return path.join(__dirname, 'blueprints');
}
},
setupPreprocessorRegistry: function(type, registry) {
var plugin = new TypeScriptPreprocessor(this.getConfig());
registry.add('js', plugin);
}
};