-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
31 lines (28 loc) · 930 Bytes
/
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
/* jshint node: true */
'use strict';
var path = require('path');
var stew = require('broccoli-stew');
module.exports = {
name: 'ember-bootstrap-4',
treeForStyles: function() {
return stew.mv(bootstrapAssetPath('scss'), '.');
},
treeForVendor: function() {
return stew.mv(bootstrapAssetPath('dist/js'), 'bootstrap');
},
included: function(app) {
app.import('bower_components/tether/dist/js/tether.js');
var plugins = (app.options.bootstrap || {}).plugins;
if (Array.isArray(plugins)) {
plugins.forEach(function(name) {
app.import('vendor/bootstrap/umd/' + name + '.js');
});
} else if (typeof plugins === 'undefined' || plugins) {
app.import('vendor/bootstrap/bootstrap.js');
}
}
};
function bootstrapAssetPath(which) {
var bootstrapPath = require.resolve('bootstrap');
return path.join(path.dirname(bootstrapPath), '../..', which);
}