Skip to content

Commit b1d6211

Browse files
authored
perf: temporary hack to avoid fs checks for /@react-refresh (#15299)
1 parent 08d093c commit b1d6211

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/vite/src/node/plugins/importAnalysis.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
338338
url = resolved.id.slice(root.length)
339339
} else if (
340340
depsOptimizer?.isOptimizedDepFile(resolved.id) ||
341-
(path.isAbsolute(cleanUrl(resolved.id)) &&
341+
// vite-plugin-react isn't following the leading \0 virtual module convention.
342+
// This is a temporary hack to avoid expensive fs checks for React apps.
343+
// We'll remove this as soon we're able to fix the react plugins.
344+
(resolved.id !== '/@react-refresh' &&
345+
path.isAbsolute(resolved.id) &&
342346
fsUtils.existsSync(cleanUrl(resolved.id)))
343347
) {
344348
// an optimized deps may not yet exists in the filesystem, or

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy