-
Notifications
You must be signed in to change notification settings - Fork 5
/
Brocfile.js
36 lines (32 loc) · 1.16 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
/*
* Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
* See LICENSE in the project root for license information.
*/
var babel = require('rollup-plugin-babel');
var merge = require('broccoli-merge-trees');
var Rollup = require('broccoli-rollup');
function getScriptTree(inputTree, entry, dest) {
return new Rollup(inputTree, {
inputFiles: ['**/*.js'],
rollup: {
entry: entry,
dest: dest,
format: 'cjs',
sourceMap: true,
plugins: [
babel({
presets: ['es2015-rollup'],
exclude: 'node_modules/**',
// TODO: Have to do this to exclude the unneeded asyncGenerator helper,
// but I should figure out why it was being included.
externalHelpersWhitelist: ['classCallCheck', 'createClass', 'inherits', 'possibleConstructorReturn']
})
]
}
});
}
var libTree = 'lib';
var cliTree = getScriptTree(libTree, 'cli/index.js', 'cli.js');
var clientTree = getScriptTree(libTree, 'client/index.js', 'client.js');
var indexTree = getScriptTree(libTree, 'index.js', 'index.js');
module.exports = merge([cliTree, clientTree, indexTree]);