-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathember-cli-build.js
105 lines (93 loc) · 3.15 KB
/
ember-cli-build.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var concat = require('broccoli-concat');
var uglifyJS = require('broccoli-uglify-js');
var Funnel = require('broccoli-funnel');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
outputPaths: {
app: {
css: {
'app': '/assets/hoodie-admin-dashboard.css',
'uikit': '/assets/uikit.css',
'uikit-guide': '/assets/uikit-guide.css'
}
}
}
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
// The JS files get appended to www/assets/vendor.js, which already includes ember
app.import('bower_components/bootstrap/js/modal.js');
// Copy the UIKit guide files over to www
var guide = new Funnel('guide', {
destDir: 'guide'
});
// Copy the Select2 image files over to www
var select2 = new Funnel('bower_components/select2', {
include: ['*.png', '*.gif'],
destDir: 'assets'
});
// Copy the dropzone image files over to www
var dropzone = new Funnel('bower_components/dropzone/downloads', {
include: ['*.png'],
destDir: 'assets'
});
// Copy prism over to assets
var prism = new Funnel('bower_components/prism', {
include: [
'prism.js',
'themes/prism.css'
],
destDir: 'assets',
getDestinationPath: function(relativePath) {
if (relativePath === 'themes/prism.css') {
return 'prism.css';
}
return relativePath;
}
});
// Copy icheck sprites over to assets
var icheck = new Funnel('bower_components/jquery-icheck', {
include: [
'skins/flat/green*.png'
],
destDir: 'assets',
getDestinationPath: function(relativePath) {
return relativePath.split('/').reverse()[0];
}
});
// Everything that needs to go into UIKit.js is
// concatenated and minified here, everytime $ember build is run
// TODO: should maybe include bootstrap js files
//
// IMPORTANT: concat produces a weird error when passing in the root folder as the
// first argument ('.'), and then having inputfiles from two different immediate
// subfolders of that root, i.e. `bower_components` and `vendor`.
// Hence this weird '../vendor' construction
var UIKitJS = concat('bower_components', {
inputFiles: [
'jquery/dist/jquery.js',
'jquery-icheck/icheck.js',
'dropzone/downloads/dropzone.js',
'select2/select2.js',
'../vendor/uikit-init.js'
],
outputFile: '/assets/uikit.js'
});
UIKitJS = uglifyJS(UIKitJS, {
compress: true
});
return app.toTree([UIKitJS, guide, prism, icheck, select2, dropzone]);
};