mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
42 lines
605 B
JavaScript
42 lines
605 B
JavaScript
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
var browserify = require('browserify');
|
|
var path = require.resolve('../');
|
|
|
|
/**
|
|
* Module exports.
|
|
*/
|
|
|
|
module.exports = build;
|
|
|
|
/**
|
|
* Make the build.
|
|
*
|
|
* @api public
|
|
*/
|
|
|
|
|
|
function build(fn){
|
|
var opts = {};
|
|
opts.builtins = false;
|
|
opts.entries = [path];
|
|
var bundle = {};
|
|
bundle.standalone = 'eio';
|
|
bundle.insertGlobalVars = { global: glob };
|
|
browserify(opts).bundle(bundle, fn);
|
|
}
|
|
|
|
/**
|
|
* Populates `global`.
|
|
*
|
|
* @api private
|
|
*/
|
|
|
|
function glob(){
|
|
return 'typeof self !== "undefined" ? self : '
|
|
+ 'typeof window !== "undefined" ? window : {}';
|
|
}
|