Skip to content

Commit 5fbeba3

Browse files
authored
fix: judge next dirent cache type (#15787)
1 parent 37382d1 commit 5fbeba3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vite/src/node/fsUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ export function createCachedFsUtils(config: ResolvedConfig): FsUtils {
148148
return
149149
}
150150
if (nextDirentCache.type === 'directory_maybe_symlink') {
151-
dirPath ??= pathUntilPart(root, parts, i)
151+
dirPath ??= pathUntilPart(root, parts, i + 1)
152152
const isSymlink = fs
153153
.lstatSync(dirPath, { throwIfNoEntry: false })
154154
?.isSymbolicLink()
155-
direntCache.type = isSymlink ? 'symlink' : 'directory'
155+
nextDirentCache.type = isSymlink ? 'symlink' : 'directory'
156156
}
157157
direntCache = nextDirentCache
158158
} else if (direntCache.type === 'symlink') {

0 commit comments

Comments
 (0)