-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-crafty.js
48 lines (47 loc) · 905 Bytes
/
build-crafty.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
var File = require('fs');
var includes = [
'core',
'intro',
'HashMap',
'2D',
'collision',
'DebugLayer',
'DOM',
'fps',
'html',
'storage',
'extensions',
'device',
'sprite',
'canvas',
'controls',
'animate',
'animation',
'drawing',
'isometric',
'particles',
'sound',
'text',
'loader',
'math',
'time',
'outro'
];
var l = includes.length;
console.log('=====================');
console.log('=== Build Started ===');
console.log('=====================');
for (var i = 0; i < l; i++) {
var base = './src/';
var filePath = base + includes[i] + '.js';
console.log('[INFO] Reading file: %s', filePath);
var buf = File.readFileSync(filePath);
if (i === 0) {
File.writeFileSync('crafty.js', buf);
} else {
File.appendFileSync('crafty.js', buf);
}
}
console.log('==================');
console.log('=== Build Over ===');
console.log('==================');