-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
56 lines (47 loc) · 1.29 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
/* eslint-disable n/no-unpublished-require */
/* eslint-env node */
'use strict';
var path = require('path');
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
var fbTransform = require('fastboot-transform');
module.exports = {
name: require('./package').name,
included() {
this._super.included.apply(this, arguments);
this.import('vendor/daterangepicker/daterangepicker.js');
this.import('vendor/daterangepicker/daterangepicker.css');
},
options: {
babel: {
plugins: ['transform-object-rest-spread'],
},
},
treeForVendor(vendorTree) {
var trees = [];
var daterangepickerPath = path.dirname(require.resolve('daterangepicker'));
if (vendorTree) {
trees.push(vendorTree);
}
trees.push(
fbTransform(
new Funnel(daterangepickerPath, {
destDir: 'daterangepicker',
include: [new RegExp(/\.js$/)],
exclude: ['moment', 'moment.min', 'package', 'website'].map(function (
key
) {
return new RegExp(key + '\\.js$');
}),
})
)
);
trees.push(
new Funnel(daterangepickerPath, {
destDir: 'daterangepicker',
include: [new RegExp(/\.css$/)],
})
);
return mergeTrees(trees);
},
};