-
Notifications
You must be signed in to change notification settings - Fork 28
/
Brocfile.js
63 lines (50 loc) · 1.43 KB
/
Brocfile.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
var pickFiles = require('broccoli-static-compiler')
var mergeTrees = require('broccoli-merge-trees')
var env = require('broccoli-env').getEnv();
var compileES6 = require('broccoli-es6-concatenator');
var findBowerTrees = require('broccoli-bower');
var sourceTrees = [];
if (env === 'production') {
// Build file
sourceTrees = sourceTrees.concat('vendor')
var js = new mergeTrees(sourceTrees, { overwrite: true })
js = compileES6('lib', {
loaderFile: '../vendor/no_loader.js',
inputFiles: [
'**/*.js'
],
wrapInEval: false,
outputFile: '/ember-sync.js'
});
sourceTrees = sourceTrees.concat(js);
} else if (env === 'development') {
var lib = pickFiles('lib', {
srcDir: '/',
destDir: '/lib'
});
sourceTrees = sourceTrees.concat(lib)
sourceTrees = sourceTrees.concat(findBowerTrees())
sourceTrees = sourceTrees.concat('vendor')
var js = new mergeTrees(sourceTrees, { overwrite: true })
js = compileES6(js, {
loaderFile: 'loader.js',
inputFiles: [
'lib/**/*.js'
],
legacyFilesToAppend: [
'jquery.js',
'ember.js',
'localstorage_adapter.js',
],
wrapInEval: true,
outputFile: '/assets/app.js'
});
sourceTrees = sourceTrees.concat(js);
var tests = pickFiles('tests', {
srcDir: '/',
destDir: '/tests'
})
sourceTrees.push(tests)
sourceTrees = sourceTrees.concat(tests);
}
module.exports = mergeTrees(sourceTrees, { overwrite: true });