-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
60 lines (47 loc) · 1.58 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
'use strict';
const path = require('path');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const resolve = require('resolve');
module.exports = {
name: 'ember-cli-lightning-design-system',
included() {
this._super.included.apply(this, arguments);
let app = this._findHost.call(this);
this.app = app;
},
treeForStyles() {
let packagePath = resolve.sync('@salesforce-ux/design-system/package.json', {
basedir: this.app.project.root
});
let root = path.dirname(packagePath);
let stylePath = path.join(root, 'scss');
let styles = new Funnel(stylePath, {
destDir: 'ember-cli-lightning-design-system/scss'
});
let designTokensPath = path.join(root, 'design-tokens', 'dist');
let designTokens = new Funnel(designTokensPath, {
destDir: 'ember-cli-lightning-design-system/design-tokens/dist'
});
return mergeTrees([styles, designTokens]);
},
treeForPublic() {
let packagePath = resolve.sync('@salesforce-ux/design-system/package.json', {
basedir: this.app.project.root
});
let root = path.dirname(packagePath);
let iconsPath = path.join(root, 'assets', 'icons');
let icons = new Funnel(iconsPath, {
destDir: 'assets/icons'
});
let fontsPath = path.join(root, 'assets', 'fonts');
let fonts = new Funnel(fontsPath, {
destDir: 'fonts'
});
let imagesPath = path.join(root, 'assets', 'images');
let images = new Funnel(imagesPath, {
destDir: 'assets/images'
});
return mergeTrees([icons, fonts, images]);
}
};