Skip to content

Commit a47ca2b

Browse files
authored
fix: use variable type instead of constant RBDT_RESOLVE_INITIAL in directory resolve condition (#20649)
1 parent b5499e0 commit a47ca2b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Fix incorrect condition in FileSystemInfo that always evaluated to false, preventing trailing slash removal from directory paths during build dependency resolution.

lib/FileSystemInfo.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,9 @@ class FileSystemInfo {
18051805
break;
18061806
}
18071807
case RBDT_RESOLVE_DIRECTORY: {
1808-
resolveDirectory(RBDT_RESOLVE_INITIAL ? path.slice(0, -1) : path);
1808+
resolveDirectory(
1809+
type === RBDT_RESOLVE_INITIAL ? path.slice(0, -1) : path
1810+
);
18091811
break;
18101812
}
18111813
case RBDT_RESOLVE_CJS_FILE: {

0 commit comments

Comments
 (0)