-
Notifications
You must be signed in to change notification settings - Fork 4
/
Brocfile.js
40 lines (35 loc) · 957 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
36
37
38
39
40
var dist = require('broccoli-dist-es6-module'),
mergeTrees = require('broccoli-merge-trees'),
pickFiles = require('broccoli-static-compiler'),
concat = require('broccoli-concat'),
uglify = require('broccoli-uglify-js'),
fs = require("fs");
var license = fs.readFileSync('./LICENSE', "utf8").split('\n').map(function (l) {
return '//' + l;
}).join('\n');
// build and only pick the global output
var distFiles = pickFiles(dist('src', {
main: 'bbcode',
global: 'bbcode',
packageName: 'bbcode'
}), {
srcDir: '/globals',
files: ['main.js'],
destDir: '/'
});
var tree = concat(distFiles,
{
inputFiles: [
'main.js'
],
outputFile: '/bbcode.js',
header: license
});
var min = concat(uglify(tree, {mangle: true}), {
inputFiles: [
'bbcode.js'
],
outputFile: '/bbcode.min.js',
header: license
});
module.exports = mergeTrees([tree, min]);