mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
40 lines
782 B
JavaScript
40 lines
782 B
JavaScript
|
|
var webpack = require('webpack');
|
|
|
|
module.exports = {
|
|
name: 'default',
|
|
entry: './lib/index.js',
|
|
output: {
|
|
library: 'io',
|
|
libraryTarget: 'umd',
|
|
filename: 'socket.io.dev.js'
|
|
},
|
|
externals: {
|
|
global: glob()
|
|
},
|
|
devtool: 'source-map',
|
|
module: {
|
|
loaders: [{
|
|
test: /\.js$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
loader: 'babel', // 'babel-loader' is also a legal name to reference
|
|
query: { presets: ['es2015'] }
|
|
}, {
|
|
test: /\json3.js/,
|
|
loader: 'imports?define=>false'
|
|
}]
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Populates `global`.
|
|
*
|
|
* @api private
|
|
*/
|
|
|
|
function glob () {
|
|
return 'typeof self !== "undefined" ? self : ' +
|
|
'typeof window !== "undefined" ? window : ' +
|
|
'typeof global !== "undefined" ? global : {}';
|
|
}
|