-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrocfile.js
58 lines (49 loc) · 1.37 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
module.exports = function (broccoli) {
var filterTemplates = require('broccoli-template')
var compileES6 = require('broccoli-es6-concatenator')
var pickFiles = require('broccoli-static-compiler')
var env = require('broccoli-env').getEnv()
var app = broccoli.makeTree('app')
app = pickFiles(app, {
srcDir: '',
destDir: 'app'
})
app = filterTemplates(app, {
extensions: ['hbs', 'handlebars'],
compileFunction: 'Ember.Handlebars.compile'
})
var vendor = broccoli.makeTree('vendor')
var tests = broccoli.makeTree('tests')
tests = pickFiles(tests, {
srcDir: '',
destDir: 'app/tests'
})
var sourceTrees = [app, vendor, tests]
sourceTrees = sourceTrees.concat(broccoli.bowerTrees())
var appAndDependencies = new broccoli.MergedTree(sourceTrees)
var appJs = compileES6(appAndDependencies, {
loaderFile: 'loader.js',
ignoredModules: [
'ember/resolver'
],
inputFiles: [
'app/**/*.js'
],
legacyFilesToAppend: [
'jquery.js',
'handlebars.js',
'ember.js',
'ember-resolver.js',
'ancient-oak-0.0.3.js'
],
wrapInEval: env !== 'production',
outputFile: '/assets/app.js'
})
var publicFiles = broccoli.makeTree('public')
var qunit = pickFiles(appAndDependencies, {
srcDir: '',
files: ['qunit.*'],
destDir: '/assets'
})
return [appJs, publicFiles, qunit]
}