vite-plugin-cross-origin-storage 1.3.20 → 1.3.21
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/index.js +1 -1
- package/dist/loader.js +5 -5
- package/loader.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1691,7 +1691,7 @@ function cosPlugin(options = {}) {
|
|
|
1691
1691
|
/[.*+?^${}()|[\]\\]/g,
|
|
1692
1692
|
"\\$&"
|
|
1693
1693
|
);
|
|
1694
|
-
const bareSpecifier =
|
|
1694
|
+
const bareSpecifier = `${base}${depFileName}`;
|
|
1695
1695
|
const staticPattern = `(import|export)\\b\\s*((?:(?!\\bimport\\b|\\bexport\\b)[\\s\\S])*?\\bfrom\\b\\s*)?['"]${escapedRelPath}['"]\\s*;?`;
|
|
1696
1696
|
const staticRegex = new RegExp(staticPattern, "g");
|
|
1697
1697
|
targetChunk.code = targetChunk.code.replace(
|
package/dist/loader.js
CHANGED
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
const loadPromises = chunksToLoad.map(async (chunk) => {
|
|
82
82
|
const dataUrl = await getChunkDataUrl(chunk);
|
|
83
83
|
if (dataUrl) {
|
|
84
|
-
// Map the
|
|
85
|
-
importMap.imports[
|
|
84
|
+
// Map the absolute path (chunk.file) to the data URL
|
|
85
|
+
importMap.imports[chunk.file] = dataUrl;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
console.log('COS Loader: Import Map injected');
|
|
98
98
|
|
|
99
99
|
// Import the main entry.
|
|
100
|
-
//
|
|
101
|
-
const
|
|
102
|
-
await import(
|
|
100
|
+
// We use the absolute path (mainEntry.file) to ensure it's resolved correctly.
|
|
101
|
+
const entryUrl = mainEntry.file;
|
|
102
|
+
await import(entryUrl);
|
|
103
103
|
|
|
104
104
|
} catch (err) {
|
|
105
105
|
console.error('COS Loader: Failed to start app', err);
|
package/loader.js
CHANGED
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
const loadPromises = chunksToLoad.map(async (chunk) => {
|
|
82
82
|
const dataUrl = await getChunkDataUrl(chunk);
|
|
83
83
|
if (dataUrl) {
|
|
84
|
-
// Map the
|
|
85
|
-
importMap.imports[
|
|
84
|
+
// Map the absolute path (chunk.file) to the data URL
|
|
85
|
+
importMap.imports[chunk.file] = dataUrl;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
console.log('COS Loader: Import Map injected');
|
|
98
98
|
|
|
99
99
|
// Import the main entry.
|
|
100
|
-
//
|
|
101
|
-
const
|
|
102
|
-
await import(
|
|
100
|
+
// We use the absolute path (mainEntry.file) to ensure it's resolved correctly.
|
|
101
|
+
const entryUrl = mainEntry.file;
|
|
102
|
+
await import(entryUrl);
|
|
103
103
|
|
|
104
104
|
} catch (err) {
|
|
105
105
|
console.error('COS Loader: Failed to start app', err);
|