From 13b32b39a4c1cf4829144fb0a95c4d0506000fb3 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 25 Feb 2021 22:49:57 +0100 Subject: [PATCH] fix: restore support for web workers A previous change ([1], included in 3.0.5) broke support for web workers, which threw "window is not defined" when importing the bundle in a web worker. Related: https://github.com/socketio/socket.io/issues/3809 Reference: https://webpack.js.org/configuration/output/#outputglobalobject [1]: https://github.com/socketio/socket.io-client/commit/8c08c5d5c3bd6dd5477ca11a2625314da57724cc --- support/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/support/webpack.config.js b/support/webpack.config.js index 82c86a3c5..282f971d7 100644 --- a/support/webpack.config.js +++ b/support/webpack.config.js @@ -11,6 +11,7 @@ module.exports = { filename: "socket.io.js", library: "io", libraryTarget: "umd", + globalObject: "this", }, mode: "development", devtool: "source-map",