Skip to content

Commit

Permalink
revert: perf: use workspace root for fs cache (vitejs#15712)
Browse files Browse the repository at this point in the history
This reverts commit 8815763.
  • Loading branch information
sapphi-red committed Apr 19, 2024
1 parent 8e54bbd commit d1e7b27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vite/src/node/fsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
safeRealpathSync,
tryStatSync,
} from './utils'
import { searchForWorkspaceRoot } from './server/searchRoot'

export interface FsUtils {
existsSync: (path: string) => boolean
Expand Down Expand Up @@ -131,7 +130,7 @@ function pathUntilPart(root: string, parts: string[], i: number): string {
}

export function createCachedFsUtils(config: ResolvedConfig): FsUtils {
const root = normalizePath(searchForWorkspaceRoot(config.root))
const root = config.root // root is resolved and normalized, so it doesn't have a trailing slash
const rootDirPath = `${root}/`
const rootCache: DirentCache = { type: 'directory' } // dirents will be computed lazily

Expand Down

0 comments on commit d1e7b27

Please sign in to comment.