-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.js
39 lines (30 loc) · 989 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
37
38
39
'use strict';
const path = require('path');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
module.exports = {
name: require('./package').name,
included(app) {
this._super.included.apply(this, arguments);
this.chartistPath = path.dirname(require.resolve('chartist'));
this.appOptions = app.options['ember-cli-chartist'] || {};
if (!this.appOptions.useCustomCSS) {
app.import('vendor/chartist.css');
}
},
treeForVendor(vendorTree) {
const chartistTree = new Funnel(this.chartistPath, {
files: ['chartist.css'],
});
return vendorTree ? mergeTrees([vendorTree, chartistTree]) : chartistTree;
},
treeForStyles(stylesTree) {
if (this.appOptions.useCustomCSS) {
const chartistTree = new Funnel(this.chartistPath, {
srcDir: 'scss',
destDir: 'chartist',
});
return stylesTree ? mergeTrees([stylesTree, chartistTree]) : chartistTree;
}
},
};