Skip to content

Commit

Permalink
fix(bundle): fix vite build
Browse files Browse the repository at this point in the history
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: socketio/socket.io-client#1504

[1]: 4971914
  • Loading branch information
darrachequesne committed Oct 15, 2021
1 parent 9a62294 commit faa9f31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit faa9f31

Please sign in to comment.