-
Notifications
You must be signed in to change notification settings - Fork 3
/
Brocfile.js
35 lines (28 loc) · 913 Bytes
/
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
var AMDFormatter = require('es6-module-transpiler-amd-formatter');
var compileModules = require('broccoli-compile-modules');
var mergeTrees = require('broccoli-merge-trees');
var closureCompiler = require('broccoli-closure-compiler');
var moveFile = require('broccoli-file-mover');
var buildTrees = [];
var bundle = compileModules('lib', {
inputFiles: ['rx-ember.umd.js'],
output: '/rx-ember.js',
formatter: 'bundle',
});
buildTrees.push(bundle);
buildTrees.push(compileModules('lib', {
inputFiles: ['**/*.js'],
output: '/amd/',
formatter: new AMDFormatter()
}));
if (process.env.EMBER_ENV === 'production') {
buildTrees.push(closureCompiler(moveFile(bundle, {
srcFile: 'rx-ember.js',
destFile: 'rx-ember.min.js'
}), {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
externs: ['node'],
}));
}
var buildTree = mergeTrees(buildTrees);
module.exports = buildTree;