-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
75 lines (63 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* eslint-env node */
'use strict';
const Funnel = require('broccoli-funnel');
const MergeTrees = require('broccoli-merge-trees');
const path = require('path');
const FastbootTransform = require('fastboot-transform');
module.exports = {
name: require('./package').name,
options: {
babel: {
// Brought in via ember-cli-babel's dep on babel preset env
plugins: ['@babel/plugin-proposal-object-rest-spread'],
},
'@embroider/macros': {
setOwnConfig: {
version: require('./package').version,
},
},
},
treeForVendor(vendorTree) {
let trees = [];
if (vendorTree) {
trees.push(vendorTree);
}
trees.push(
FastbootTransform(
new Funnel(path.dirname(require.resolve('@imgix/js-core')), {
files: ['imgix-js-core.umd.js'],
destDir: 'imgix-js-core',
})
)
);
trees.push(
FastbootTransform(
new Funnel(path.dirname(require.resolve('js-base64')), {
files: ['base64.js'],
destDir: 'js-base64',
})
)
);
trees.push(
new Funnel(path.dirname(require.resolve('jsuri')), {
files: ['Uri.js'],
destDir: 'jsuri',
})
);
return MergeTrees(trees);
},
included() {
this._super(arguments);
this.import('vendor/js-base64/base64.js');
this.import('vendor/imgix-js-core/imgix-js-core.umd.js');
this.import('vendor/imgix-js-core-shim.js');
this.import('vendor/jsuri/Uri.js', {
using: [
{
transformation: 'amd',
as: 'jsuri',
},
],
});
},
};