forked from imgix/ember-cli-imgix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
66 lines (54 loc) · 1.36 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
/* 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: 'ember-cli-imgix',
options: {
babel: {
plugins: [
'inline-package-json',
'transform-object-rest-spread',
],
}
},
treeForVendor(vendorTree) {
let trees = [];
if (vendorTree) {
trees.push(vendorTree);
}
trees.push(FastbootTransform(
new Funnel(path.dirname(require.resolve('imgix-core-js')), {
files: ['imgix-core-js.js'],
destDir: 'imgix-core-js',
})
));
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-core-js/imgix-core-js.js');
this.import('vendor/imgix-core-js-shim.js');
this.import('vendor/jsuri/Uri.js', {
using: [
{
transformation: 'amd',
as: 'jsuri',
},
],
});
}
};