vite-plugin-cross-origin-storage 1.3.13 → 1.3.14
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/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1667,6 +1667,7 @@ 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 + "/";
|
|
1670
1671
|
const managedChunkNames = new Set(Object.keys(managedChunks));
|
|
1671
1672
|
const managedChunkInfo = {};
|
|
1672
1673
|
for (const fileName in managedChunks) {
|
|
@@ -1690,7 +1691,7 @@ function cosPlugin(options = {}) {
|
|
|
1690
1691
|
/[.*+?^${}()|[\]\\]/g,
|
|
1691
1692
|
"\\$&"
|
|
1692
1693
|
);
|
|
1693
|
-
const bareSpecifier = depFileName
|
|
1694
|
+
const bareSpecifier = `${base}${depFileName}`;
|
|
1694
1695
|
const staticPattern = `(import|export)\\b\\s*((?:(?!\\bimport\\b|\\bexport\\b)[\\s\\S])*?\\bfrom\\b\\s*)?['"]${escapedRelPath}['"]\\s*;?`;
|
|
1695
1696
|
const staticRegex = new RegExp(staticPattern, "g");
|
|
1696
1697
|
targetChunk.code = targetChunk.code.replace(
|
|
@@ -1709,7 +1710,6 @@ function cosPlugin(options = {}) {
|
|
|
1709
1710
|
}
|
|
1710
1711
|
}
|
|
1711
1712
|
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");
|