We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08d093c commit b1d6211Copy full SHA for b1d6211
packages/vite/src/node/plugins/importAnalysis.ts
@@ -338,7 +338,11 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
338
url = resolved.id.slice(root.length)
339
} else if (
340
depsOptimizer?.isOptimizedDepFile(resolved.id) ||
341
- (path.isAbsolute(cleanUrl(resolved.id)) &&
+ // 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) &&
346
fsUtils.existsSync(cleanUrl(resolved.id)))
347
) {
348
// an optimized deps may not yet exists in the filesystem, or
0 commit comments