Skip to content

Commit

Permalink
[fix] Remove any reference to the global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sunrise30 committed Nov 28, 2018
1 parent 14abdb1 commit 69214b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"parser": "babel-eslint",
"env": {
// Note: mocha env is defined inside test/.eslintrc.json
"node": true
"node": true,
"browser": true
},
"rules": {
"yoda": 0,
Expand Down
2 changes: 1 addition & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function url (uri, loc) {
var obj = uri;

// default to window.location
loc = loc || global.location;
loc = loc || (typeof location !== 'undefined' && location);
if (null == uri) uri = loc.protocol + '//' + loc.host;

// relative path support
Expand Down
6 changes: 3 additions & 3 deletions support/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ module.exports = {
externals: {
global: glob()
},
node: {
Buffer: false
},
devtool: 'source-map',
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}]
}
};
Expand Down
9 changes: 4 additions & 5 deletions support/webpack.config.slim.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ module.exports = {
filename: 'socket.io.slim.dev.js'
},
externals: {
global: glob(),
json3: 'JSON'
global: glob()
},
node: {
Buffer: false
},
devtool: 'source-map',
plugins: [
Expand All @@ -23,9 +25,6 @@ module.exports = {
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}, {
test: /\.js$/,
loader: 'strip-loader?strip[]=debug'
Expand Down

0 comments on commit 69214b1

Please sign in to comment.