forked from josemarluedke/ember-cli-daterangepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
54 lines (44 loc) · 1.31 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
/* 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: 'ember-cli-daterangepicker',
included() {
this._super.included.apply(this, arguments);
this.import('vendor/bootstrap-daterangepicker/daterangepicker.js');
this.import('vendor/bootstrap-daterangepicker/daterangepicker.css');
},
options: {
babel: {
plugins: ['transform-object-rest-spread'],
},
},
treeForVendor(vendorTree) {
var trees = [];
var daterangepickerPath = path.dirname(require.resolve('bootstrap-daterangepicker'));
if (vendorTree) {
trees.push(vendorTree);
}
//need to wrap with check if it's inside fastboot environment
trees.push(fbTransform(new Funnel(daterangepickerPath, {
destDir: 'bootstrap-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: 'bootstrap-daterangepicker',
include: [new RegExp(/\.css$/)]
}));
return mergeTrees(trees);
}
};