forked from ef4/ember-sass-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (30 loc) · 964 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
32
33
/* jshint node: true */
'use strict';
var path = require('path');
var stew = require('broccoli-stew');
module.exports = {
name: 'ember-sass-bootstrap',
treeForStyles: function() {
return stew.mv(bootstrapAssetPath('stylesheets'), '.');
},
treeForPublic: function() {
return stew.mv(bootstrapAssetPath('fonts'), 'fonts');
},
treeForVendor: function() {
return stew.mv(bootstrapAssetPath('javascripts'), 'bootstrap');
},
included: function(app) {
var plugins = (app.options.bootstrap || {}).plugins;
if (Array.isArray(plugins)) {
plugins.forEach(function(name) {
app.import('vendor/bootstrap/bootstrap/' + name + '.js');
});
} else if (typeof plugins === 'undefined' || plugins) {
app.import('vendor/bootstrap/bootstrap.js');
}
}
};
function bootstrapAssetPath(which) {
var bootstrapPath = require.resolve('bootstrap-sass');
return path.join(path.dirname(bootstrapPath), '..', which);
}