forked from purecloudlabs/fixtable-ember
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
61 lines (48 loc) · 1.63 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* eslint-env node */
'use strict';
const fs = require('fs');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const path = require('path');
module.exports = {
name: 'fixtable-ember',
included(parent) {
this._super.included.apply(this, arguments);
// Find the top-level app if this is nested within other addons
while (parent.app) {
parent = parent.app;
}
let fontAwesomeToImport = fs.readdirSync(`${this.nodeModulesPath}/font-awesome/fonts`);
fontAwesomeToImport.forEach((fontFileName) => {
parent.import(path.join('vendor', 'fonts', fontFileName));
});
parent.import(path.join(this.nodeModulesPath, 'fixtable/dist/fixtable.js'));
parent.import('vendor/styles/fixtable-ember.css');
parent.import('vendor/styles/font-awesome.css');
parent.import('vendor/styles/fixtable.css');
},
treeForVendor(tree) {
let treesToMerge = [];
if (tree) {
treesToMerge.push(tree);
}
let fontAwesomeFunnel = new Funnel(`${this.nodeModulesPath}/font-awesome`, {
srcDir: 'fonts',
destDir: 'fonts'
});
treesToMerge.push(fontAwesomeFunnel);
let fontAwesomeCssFunnel = new Funnel(`${this.nodeModulesPath}/font-awesome`, {
srcDir: 'css',
files:['font-awesome.css'],
destDir: 'styles'
});
treesToMerge.push(fontAwesomeCssFunnel);
let fixtableCssFunnel = new Funnel(`${this.nodeModulesPath}/fixtable`, {
srcDir: 'dist',
files: ['fixtable.css'],
destDir: 'styles'
});
treesToMerge.push(fixtableCssFunnel);
return mergeTrees(treesToMerge, { overwrite: true });
}
};