From 11c4814c440a2158354868972602c649edff0d4d Mon Sep 17 00:00:00 2001 From: patak Date: Thu, 25 Jan 2024 12:10:58 +0100 Subject: [PATCH] feat: use workspace root for fs cache --- packages/vite/src/node/fsUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/fsUtils.ts b/packages/vite/src/node/fsUtils.ts index c8f6c532af7158..1f3116727854fd 100644 --- a/packages/vite/src/node/fsUtils.ts +++ b/packages/vite/src/node/fsUtils.ts @@ -8,6 +8,7 @@ import { safeRealpathSync, tryStatSync, } from './utils' +import { searchForWorkspaceRoot } from './server/searchRoot' export interface FsUtils { existsSync: (path: string) => boolean @@ -124,7 +125,7 @@ function pathUntilPart(root: string, parts: string[], i: number): string { } export function createCachedFsUtils(config: ResolvedConfig): FsUtils { - const root = config.root // root is resolved and normalized, so it doesn't have a trailing slash + const root = normalizePath(searchForWorkspaceRoot(config.root)) const rootDirPath = `${root}/` const rootCache: DirentCache = { type: 'directory' } // dirents will be computed lazily