From faa9f318e70cd037af79bfa20e9d21b284ddf257 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Sat, 16 Oct 2021 01:36:18 +0200 Subject: [PATCH] fix(bundle): fix vite build Some bundlers (like vite) do not support having a "browser" field in a nested package.json. Note: the previous commit ([1]) fixed the resolution of the "browser" field in the dev bundle, but the production bundle still failed. Related: https://github.com/socketio/socket.io-client/issues/1504 [1]: https://github.com/socketio/engine.io-client/commit/49719142f65e23efa65fca4f66765ded5d955972 --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9db05a5a7..9d101ceb6 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,10 @@ "prepack": "npm run compile" }, "browser": { - "./test/node.js": false + "./test/node.js": false, + "./build/esm/transports/xmlhttprequest.js": "./build/esm/transports/xmlhttprequest.browser.js", + "./build/esm/transports/websocket-constructor.js": "./build/esm/transports/websocket-constructor.browser.js", + "./build/esm/globalThis.js": "./build/esm/globalThis.browser.js" }, "repository": { "type": "git",