Files
socket.io/build.js
Guillermo Rauch 5cebe02f5d Builder now puts a notice at the top of the file
Fixed indentation
2010-03-18 20:50:31 -07:00

56 lines
1.3 KiB
JavaScript
Executable File

#!/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!');