-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It seems vite has issues with absolute dependencies in the "browser" field, so we'll provide a quick workaround. Related: - socketio/socket.io-client#1494 - socketio/socket.io-client#1495
- Loading branch information
1 parent
b3bb73a
commit 4971914
Showing
5 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// browser shim for xmlhttprequest module | ||
|
||
import hasCORS from "has-cors"; | ||
import globalThis from "../globalThis.js"; | ||
|
||
export default function(opts) { | ||
const xdomain = opts.xdomain; | ||
|
||
// XMLHttpRequest can be disabled on IE | ||
try { | ||
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) { | ||
return new XMLHttpRequest(); | ||
} | ||
} catch (e) {} | ||
|
||
if (!xdomain) { | ||
try { | ||
return new globalThis[["Active"].concat("Object").join("X")]( | ||
"Microsoft.XMLHTTP" | ||
); | ||
} catch (e) {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as XMLHttpRequestModule from "xmlhttprequest-ssl"; | ||
|
||
const XMLHttpRequest = XMLHttpRequestModule.default || XMLHttpRequestModule; | ||
|
||
export default XMLHttpRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters