Skip to content

Commit

Permalink
perf: use fs.realpath.native directly when windowsNetworkMap is e…
Browse files Browse the repository at this point in the history
…mpty

Co-Authored-By: patak <583075+patak-dev@users.noreply.github.com>
  • Loading branch information
sapphi-red and patak-dev committed Mar 26, 2023
1 parent 9a6af8e commit 6321752
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -635,7 +635,11 @@ function optimizeSafeRealPathSync() {
const m = line.match(parseNetUseRE)
if (m) windowsNetworkMap.set(m[3], m[2])
}
safeRealpathSync = windowsMappedRealpathSync
if (windowsNetworkMap.size === 0) {
safeRealpathSync = fs.realpathSync.native
} else {
safeRealpathSync = windowsMappedRealpathSync
}
})
}

Expand Down

0 comments on commit 6321752

Please sign in to comment.