-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·48 lines (41 loc) · 1.61 KB
/
index.js
File metadata and controls
executable file
·48 lines (41 loc) · 1.61 KB
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
var fs = require('fs');
var path = require('path');
module.exports = {
name: 'ember-cli-ratchet',
included: function included(app) {
this.app = app;
var options = app.options['ember-cli-ratchet'] || {};
var modulePath = path.relative(app.project.root, __dirname);
var ratchetPath = 'vendor/ratchet/';
var cssPath = path.join(ratchetPath, 'dist/css')
var javascriptsPath = path.join(ratchetPath, 'js');
var jsFiles = options.jsComponents ? options.jsComponents : fs.readdirSync(path.join(modulePath, javascriptsPath));
// Import css from bootstrap
app.import(path.join(cssPath, 'ratchet.css'));
if (options.theme) {
app.import(path.join(cssPath, 'ratchet-theme-' + options.theme + '.css'));
}
// Import javascript files
if (options.importRatchetJs) {
jsFiles.forEach(function (file) {
var fileName = file.split('.')[0];
if (fileName.length > 0) {
app.import(path.join(javascriptsPath, fileName + '.js'));
}
});
}
// Import glyphicons
app.import(path.join(ratchetPath, 'dist/fonts/ratchicons.eot'), {
destDir: '/fonts'
});
app.import(path.join(ratchetPath, 'dist/fonts/ratchicons.svg'), {
destDir: '/fonts'
});
app.import(path.join(ratchetPath, 'dist/fonts/ratchicons.ttf'), {
destDir: '/fonts'
});
app.import(path.join(ratchetPath, 'dist/fonts/ratchicons.woff'), {
destDir: '/fonts'
});
}
};