vite 7.2.0 → 7.2.1
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.
|
@@ -23898,9 +23898,9 @@ function toRelativePath(filename, importer) {
|
|
|
23898
23898
|
const relPath = path.posix.relative(path.posix.dirname(importer), filename);
|
|
23899
23899
|
return relPath[0] === "." ? relPath : `./${relPath}`;
|
|
23900
23900
|
}
|
|
23901
|
-
function
|
|
23902
|
-
|
|
23903
|
-
return
|
|
23901
|
+
function findPreloadMarker(str, pos = 0) {
|
|
23902
|
+
preloadMarkerRE.lastIndex = pos;
|
|
23903
|
+
return preloadMarkerRE.exec(str)?.index ?? -1;
|
|
23904
23904
|
}
|
|
23905
23905
|
/**
|
|
23906
23906
|
* Helper for preloading CSS and direct imports of async chunks in parallel to
|
|
@@ -24186,8 +24186,8 @@ function buildImportAnalysisPlugin(config$2) {
|
|
|
24186
24186
|
};
|
|
24187
24187
|
addDeps(normalizedFile);
|
|
24188
24188
|
}
|
|
24189
|
-
let markerStartPos$1 =
|
|
24190
|
-
if (markerStartPos$1 === -1 && imports.length === 1) markerStartPos$1 =
|
|
24189
|
+
let markerStartPos$1 = findPreloadMarker(code, end);
|
|
24190
|
+
if (markerStartPos$1 === -1 && imports.length === 1) markerStartPos$1 = findPreloadMarker(code);
|
|
24191
24191
|
if (markerStartPos$1 > 0) {
|
|
24192
24192
|
let depsArray = deps.size > 1 || hasRemovedPureCssChunk && deps.size > 0 ? modulePreload === false ? [...deps].filter((d$2) => d$2.endsWith(".css")) : [...deps] : [];
|
|
24193
24193
|
const resolveDependencies = modulePreload ? modulePreload.resolveDependencies : void 0;
|
|
@@ -24216,10 +24216,10 @@ function buildImportAnalysisPlugin(config$2) {
|
|
|
24216
24216
|
if (code.startsWith("#!")) s$2.prependLeft(code.indexOf("\n") + 1, mapDepsCode);
|
|
24217
24217
|
else s$2.prepend(mapDepsCode);
|
|
24218
24218
|
}
|
|
24219
|
-
let markerStartPos =
|
|
24219
|
+
let markerStartPos = findPreloadMarker(code);
|
|
24220
24220
|
while (markerStartPos >= 0) {
|
|
24221
24221
|
if (!rewroteMarkerStartPos.has(markerStartPos)) s$2.update(markerStartPos, markerStartPos + preloadMarker.length, "void 0");
|
|
24222
|
-
markerStartPos =
|
|
24222
|
+
markerStartPos = findPreloadMarker(code, markerStartPos + preloadMarker.length);
|
|
24223
24223
|
}
|
|
24224
24224
|
if (s$2.hasChanged()) {
|
|
24225
24225
|
chunk.code = s$2.toString();
|
|
@@ -27488,7 +27488,7 @@ function webWorkerPlugin(config$2) {
|
|
|
27488
27488
|
emittedAssets.add(asset.fileName);
|
|
27489
27489
|
const duplicateAsset = bundle[asset.fileName];
|
|
27490
27490
|
if (duplicateAsset) {
|
|
27491
|
-
if (isSameContent(duplicateAsset.type === "asset" ? duplicateAsset.source : duplicateAsset.code, asset.source))
|
|
27491
|
+
if (isSameContent(duplicateAsset.type === "asset" ? duplicateAsset.source : duplicateAsset.code, asset.source)) continue;
|
|
27492
27492
|
}
|
|
27493
27493
|
this.emitFile({
|
|
27494
27494
|
type: "asset",
|