forked from kimroen/ember-cli-coffeescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (26 loc) · 1.05 KB
/
index.js
File metadata and controls
37 lines (26 loc) · 1.05 KB
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
37
'use strict';
var path = require('path');
var CoffeePreprocessor = require('./lib/coffee-preprocessor');
function CoffeescriptAddon(project) {
this._project = project;
this.name = 'Ember CLI Coffeescript Addon';
}
CoffeescriptAddon.prototype.blueprintsPath = function() {
return path.join(__dirname, 'blueprints');
};
CoffeescriptAddon.prototype.included = function(app) {
var options = app.options;
this.app = app;
options.coffeeOptions = options.coffeeOptions || {};
// Roll the coffeelintOptions and coffeeOptions into one to pass them through.
if (options.coffeelintOptions && !options.coffeeOptions.coffeelintOptions) {
options.coffeeOptions.coffeelintOptions = options.coffeelintOptions;
delete options.coffeelintOptions;
}
var plugin = new CoffeePreprocessor(app.options.coffeeOptions);
this.app.registry.add('js', plugin);
};
// This is just here because it was required in ember-cli v0.0.37.
// To be removed when compatibility breaks.
CoffeescriptAddon.prototype.treeFor = function() {};
module.exports = CoffeescriptAddon;