forked from socketio/socket.io-client
/
build.js
executable file
·56 lines (48 loc) · 1.33 KB
/
build.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
#!/usr/bin/env node
/**
* Socket.IO client
*
* @author Guillermo Rauch <guillermo@rosepad.com>
* @license The MIT license.
* @copyright Copyright (c) 2009 RosePad <dev@rosepad.com>
*/
/*
* This file will help you take all the Socket.IO client files and build socket.io.js.
* You can later use Google Closure Compiler on it.
*/
var fs = require('fs'),
sys = require('sys'),
socket = require('./lib/io'),
files = [
'io.js',
'util/util.js',
'util/object.js',
'util/array.js',
'util/options.js',
'util/events.js',
'util/json.js',
'util/oo.js',
'transport.js',
'transports/xhr.js',
'transports/websocket.js',
'transports/flashsocket.js',
'transports/htmlfile.js',
'transports/server-events.js',
'transports/xhr-multipart.js',
'transports/xhr-polling.js',
'socket.js',
'vendor/web-socket-js/swfobject.js',
'vendor/web-socket-js/FABridge.js',
'vendor/web-socket-js/web_socket.js'
],
content = "/** Socket.IO "+ socket.io.version +" - Built with build.js */\n";
sys.log('Reading files…');
files.forEach(function(file){
var path = __dirname + '/lib/' + file;
sys.log (' + ' + path);
content += fs.readFileSync(path) + "\n";
});
sys.log('Generating…');
fs.write(fs.openSync(__dirname + '/socket.io.js', 'w'), content, 0, 'utf8');
sys.log(' + ' + __dirname + '/socket.io.js');
sys.log('All done!');