Skip to content

Commit 10e56ad

Browse files
committed
fix(bench): normalize path.relative to POSIX in linkChunks resolveId
path.relative returns backslash-separated paths on Windows, but chunk fileName keys from Rollup/Rolldown always use forward slashes. The files Map lookup would miss the entry chunk on Windows.
1 parent 5a5ef25 commit 10e56ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎benchmarks/bundle-size/run-minimal.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ async function linkChunks(chunks, entryChunk) {
404404
resolveId(source, importer) {
405405
const file = importer?.startsWith(prefix)
406406
? path.posix.join(path.posix.dirname(importer.slice(prefix.length)), source)
407-
: path.relative(directory, source);
407+
: path.relative(directory, source).replaceAll('\\', '/');
408408
return files.has(file) ? prefix + file : null;
409409
},
410410
load(id) {

0 commit comments

Comments
 (0)