vite-plugin-cross-origin-storage 1.3.14 → 1.3.15
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 +2 -2
- package/dist/loader.js +2 -2
- package/loader.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1667,7 +1667,6 @@ function cosPlugin(options = {}) {
|
|
|
1667
1667
|
const allChunks = Object.values(bundle).filter(
|
|
1668
1668
|
(c) => c.type === "chunk"
|
|
1669
1669
|
);
|
|
1670
|
-
const base = config.base.endsWith("/") ? config.base : config.base + "/";
|
|
1671
1670
|
const managedChunkNames = new Set(Object.keys(managedChunks));
|
|
1672
1671
|
const managedChunkInfo = {};
|
|
1673
1672
|
for (const fileName in managedChunks) {
|
|
@@ -1691,7 +1690,7 @@ function cosPlugin(options = {}) {
|
|
|
1691
1690
|
/[.*+?^${}()|[\]\\]/g,
|
|
1692
1691
|
"\\$&"
|
|
1693
1692
|
);
|
|
1694
|
-
const bareSpecifier =
|
|
1693
|
+
const bareSpecifier = `cos-id:${depFileName}`;
|
|
1695
1694
|
const staticPattern = `(import|export)\\b\\s*((?:(?!\\bimport\\b|\\bexport\\b)[\\s\\S])*?\\bfrom\\b\\s*)?['"]${escapedRelPath}['"]\\s*;?`;
|
|
1696
1695
|
const staticRegex = new RegExp(staticPattern, "g");
|
|
1697
1696
|
targetChunk.code = targetChunk.code.replace(
|
|
@@ -1710,6 +1709,7 @@ function cosPlugin(options = {}) {
|
|
|
1710
1709
|
}
|
|
1711
1710
|
}
|
|
1712
1711
|
const manifest = {};
|
|
1712
|
+
const base = config.base.endsWith("/") ? config.base : config.base + "/";
|
|
1713
1713
|
for (const fileName in managedChunkInfo) {
|
|
1714
1714
|
const { chunk, globalVar } = managedChunkInfo[fileName];
|
|
1715
1715
|
const finalHash = crypto.createHash("sha256").update(chunk.code).digest("hex");
|
package/dist/loader.js
CHANGED
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
const shim = `export * from "${url}";${chunk.hasDefault ? `export { default } from "${url}";` : ''}`;
|
|
113
113
|
const shimUrl = `data:text/javascript;base64,${btoa(shim)}`;
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
importMap.imports[chunk.
|
|
115
|
+
// Map the virtual bare specifier to the shim
|
|
116
|
+
importMap.imports[`cos-id:${chunk.fileName}`] = shimUrl;
|
|
117
117
|
|
|
118
118
|
// Also set global if anyone still needs it (legacy)
|
|
119
119
|
if (chunk.globalVar) {
|
package/loader.js
CHANGED
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
const shim = `export * from "${url}";${chunk.hasDefault ? `export { default } from "${url}";` : ''}`;
|
|
113
113
|
const shimUrl = `data:text/javascript;base64,${btoa(shim)}`;
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
importMap.imports[chunk.
|
|
115
|
+
// Map the virtual bare specifier to the shim
|
|
116
|
+
importMap.imports[`cos-id:${chunk.fileName}`] = shimUrl;
|
|
117
117
|
|
|
118
118
|
// Also set global if anyone still needs it (legacy)
|
|
119
119
|
if (chunk.globalVar) {
|