forked from ember-bootstrap/ember-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
51 lines (41 loc) · 2.02 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
/* jshint node: true */
'use strict';
var path = require('path'),
util = require('util'),
extend = util._extend;
var defaultOptions = {
importBootstrapTheme: false,
importBootstrapCSS: true,
importBootstrapFont: true
};
module.exports = {
name: 'ember-bootstrap-components',
included: function included(app) {
this._super.included(app);
var emberCLIVersion = app.project.emberCLIVersion();
if (emberCLIVersion < '0.0.41') {
throw new Error('ember-cli-bootstrap requires ember-cli version 0.0.41 or greater.\n');
}
var options = extend(defaultOptions, app.options['ember-bootstrap-components']);
var bootstrapPath = path.join(app.bowerDirectory, 'bootstrap/dist');
// Import css from bootstrap
if (options.importBootstrapTheme) {
app.import(path.join(bootstrapPath, 'css/bootstrap-theme.css'));
}
if (options.importBootstrapCSS) {
app.import(path.join(bootstrapPath, 'css/bootstrap.css'));
app.import(path.join(bootstrapPath, 'css/bootstrap.css.map'), { destDir: 'assets' });
}
// Import glyphicons
if (options.importBootstrapFont) {
app.import(path.join(bootstrapPath, 'fonts/glyphicons-halflings-regular.eot'), { destDir: '/fonts' });
app.import(path.join(bootstrapPath, 'fonts/glyphicons-halflings-regular.svg'), { destDir: '/fonts' });
app.import(path.join(bootstrapPath, 'fonts/glyphicons-halflings-regular.ttf'), { destDir: '/fonts' });
app.import(path.join(bootstrapPath, 'fonts/glyphicons-halflings-regular.woff'), { destDir: '/fonts' });
app.import(path.join(bootstrapPath, 'fonts/glyphicons-halflings-regular.woff2'), { destDir: '/fonts' });
}
app.import(path.join(app.bowerDirectory, 'waves/dist/waves.min.js'));
app.import(path.join(app.bowerDirectory, 'waves/dist/waves.min.css'));
app.import(path.join(app.bowerDirectory, 'bootstrap/js/transition.js'));
}
};