Skip to content

Commit

Permalink
fix: resolve directory correctly when fs.cachedChecks: true
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Feb 20, 2024
1 parent ad943cb commit 52e6198
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/fsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export function createCachedFsUtils(config: ResolvedConfig): FsUtils {
function getDirentCacheFromPath(
normalizedFile: string,
): DirentCache | false | undefined {
// path.posix.normalize may return a path either with / or without /
if (normalizedFile[normalizedFile.length - 1] === '/') {
normalizedFile = normalizedFile.slice(0, -1)
}
if (normalizedFile === root) {
return rootCache
}
Expand Down

0 comments on commit 52e6198

Please sign in to comment.