-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
70 lines (56 loc) · 1.58 KB
/
Copy pathindex.js
File metadata and controls
70 lines (56 loc) · 1.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* jshint node: true */
'use strict';
const mergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const cacheKeyForTree = require('calculate-cache-key-for-tree');
const path = require('path');
const { name, version } = require('./package');
const faPath = path.dirname(require.resolve('@fortawesome/fontawesome-pro/package.json'));
module.exports = {
name,
version,
isDevelopingAddon: function () {
return true;
},
options: {
autoImport: {
exclude: ['@storybook/addon-actions']
}
},
included(parent) {
this._super.included.apply(this, arguments);
if (parent.project.pkg.name === name) {
this.options.babel.plugins.push(...require('ember-cli-code-coverage').buildBabelPlugin());
}
},
treeForAddon(tree) {
const filtered = new Funnel(tree, {
exclude: ['**/*.stories.js', '**/*.stories.ts', '**/*.stories.mdx']
});
return this._super.treeForAddon.apply(this, [filtered]);
},
treeForPublic() {
const publicTree = this._super.treeForPublic.apply(this, arguments);
const trees = [];
if (publicTree) {
trees.push(publicTree);
}
trees.push(
new Funnel(`${faPath}/webfonts/`, {
srcDir: '/',
include: [
'**/fa-brands-*.woff2',
'**/fa-duotone-*.woff2',
'**/fa-light-*.woff2',
'**/fa-regular-*.woff2',
'**/fa-solid-*.woff2'
],
destDir: '/webfonts'
})
);
return mergeTrees(trees);
},
cacheKeyForTree(treeType) {
return cacheKeyForTree(treeType, this, this.pkg);
}
};