-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmake.js
86 lines (73 loc) · 1.87 KB
/
make.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Contrary to popular belief, this file is meant to be a JS code concatenator.
// It *does not minimize* the code.
// It is meant to be used in a node environment, as in , `node make.js`.
var fs = require('fs');
var path = require('path');
function bundle(file, inputs) {
var output = fs.createWriteStream(file);
(function cat(i) {
var input = fs.createReadStream(path.join(__dirname, inputs[i]));
input.pipe(output, {end: false});
input.on('end', function() {
var next = i + 1;
if (next < inputs.length) {
cat(next);
} else {
output.end();
}
});
}(0));
}
// Union of lists (in the correct order).
function union(lists) {
var ulist = [];
for (var i = 0; i < lists.length; i++) {
ulist = ulist.concat(lists[i]);
}
return ulist;
}
// Web workers for static analysis.
bundle('demo/parser-worker.js', [
'node_modules/esprima/esprima.js',
'js/worker-parser.js',
]);
// Target environment: AMD / Node.js / plain old browsers.
//
var aulxBundle = [
'entrance/umd-begin.js',
'entrance/completers.js',
// JS completion files.
'entrance/compl-begin.js',
'js/main.js',
'js/static.js',
'js/sandbox.js',
'js/keyword.js',
'entrance/compl-end.js',
// CSS completion files.
'entrance/compl-begin.js',
'css/main.js',
'css/state-machine.js',
'css/selectors.js',
'css/css-token-begin.js',
'css/tokenizer.js',
'css/css-token-end.js',
'css/properties.js',
'entrance/compl-end.js',
// HTML completion files.
'entrance/compl-begin.js',
'html/main.js',
'html/tokenizer.js',
'entrance/compl-end.js',
'entrance/umd-end.js',
];
bundle('aulx.js', aulxBundle);
// Target environment: AMD / plain old browsers.
// Contains UI code for text editors.
//
bundle('aulx-ui.js', union([aulxBundle, [
'entrance/umd-begin-ui.js',
'ui/main.js',
'ui/popup.js',
'ui/cm.js',
'entrance/umd-end.js',
]]));