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 CHANGED
@@ -106,10 +106,14 @@
106
106
  }
107
107
 
108
108
  if (url) {
109
- // Map the bare specifier and absolute path directly to the Blob URL.
110
- // This avoids the indirection of a Data URL shim and handles cycles naturally.
111
- importMap.imports[chunk.fileName] = url;
112
- importMap.imports[chunk.file] = url;
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
- // Map the bare specifier and absolute path directly to the Blob URL.
110
- // This avoids the indirection of a Data URL shim and handles cycles naturally.
111
- importMap.imports[chunk.fileName] = url;
112
- importMap.imports[chunk.file] = url;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-cross-origin-storage",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "description": "Vite plugin to load chunks from Cross-Origin Storage",
5
5
  "keywords": [
6
6
  "vite",