-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.js
More file actions
executable file
·35 lines (30 loc) · 858 Bytes
/
build.js
File metadata and controls
executable file
·35 lines (30 loc) · 858 Bytes
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
#!/usr/bin/env node
var compressor = require('node-minify')
, fs = require('fs');
var srcFiles = [
'src/agent.js',
'src/kdtree.js',
'src/obstacle.js',
'src/rvo.js',
'src/simulator.js',
'src/vector.js'
];
var license = "/*\n" + fs.readFileSync('LICENSE').toString() + "\n*/\n\n";
new compressor.minify({
type: 'yui-js',
fileIn: srcFiles,
fileOut: '/tmp/rvo2.min.js',
callback: function(err){
fs.writeFileSync('lib/rvo2.min.js', license.concat(fs.readFileSync('/tmp/rvo2.min.js').toString()));
console.log(err || 'Done buliding rvo2.min.js');
}
});
new compressor.minify({
type: 'no-compress',
fileIn: srcFiles,
fileOut: '/tmp/rvo2.js',
callback: function(err){
fs.writeFileSync('lib/rvo2.js', license.concat(fs.readFileSync('/tmp/rvo2.js').toString()));
console.log(err || 'Done building rvo2.js');
}
});