Skip to content

Commit faa9f31

Browse files
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: socketio/socket.io-client#1504 [1]: 4971914
1 parent 9a62294 commit faa9f31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@
8686
"prepack": "npm run compile"
8787
},
8888
"browser": {
89-
"./test/node.js": false
89+
"./test/node.js": false,
90+
"./build/esm/transports/xmlhttprequest.js": "./build/esm/transports/xmlhttprequest.browser.js",
91+
"./build/esm/transports/websocket-constructor.js": "./build/esm/transports/websocket-constructor.browser.js",
92+
"./build/esm/globalThis.js": "./build/esm/globalThis.browser.js"
9093
},
9194
"repository": {
9295
"type": "git",

0 commit comments

Comments
 (0)