vite-plugin-cross-origin-storage 1.3.12 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loader.js +8 -4
- package/loader.js +8 -4
- package/package.json +1 -1
package/dist/loader.js
CHANGED
|
@@ -106,10 +106,14 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
if (url) {
|
|
109
|
-
//
|
|
110
|
-
// This
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
// Use a Data URL shim to decouple the import graph.
|
|
110
|
+
// This ensures that the circular dependency between React and React-DOM
|
|
111
|
+
// doesn't cause a lockout/deadlock during the module graph instantiation.
|
|
112
|
+
const shim = `export * from "${url}";${chunk.hasDefault ? `export { default } from "${url}";` : ''}`;
|
|
113
|
+
const shimUrl = `data:text/javascript;base64,${btoa(shim)}`;
|
|
114
|
+
|
|
115
|
+
importMap.imports[chunk.fileName] = shimUrl;
|
|
116
|
+
importMap.imports[chunk.file] = shimUrl;
|
|
113
117
|
|
|
114
118
|
// Also set global if anyone still needs it (legacy)
|
|
115
119
|
if (chunk.globalVar) {
|
package/loader.js
CHANGED
|
@@ -106,10 +106,14 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
if (url) {
|
|
109
|
-
//
|
|
110
|
-
// This
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
// Use a Data URL shim to decouple the import graph.
|
|
110
|
+
// This ensures that the circular dependency between React and React-DOM
|
|
111
|
+
// doesn't cause a lockout/deadlock during the module graph instantiation.
|
|
112
|
+
const shim = `export * from "${url}";${chunk.hasDefault ? `export { default } from "${url}";` : ''}`;
|
|
113
|
+
const shimUrl = `data:text/javascript;base64,${btoa(shim)}`;
|
|
114
|
+
|
|
115
|
+
importMap.imports[chunk.fileName] = shimUrl;
|
|
116
|
+
importMap.imports[chunk.file] = shimUrl;
|
|
113
117
|
|
|
114
118
|
// Also set global if anyone still needs it (legacy)
|
|
115
119
|
if (chunk.globalVar) {
|