Skip to content

Commit

Permalink
fix: don't append /@fs/ for bare imports (#14995)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Nov 15, 2023
1 parent d3af879 commit 2a519a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
url = resolved.id.slice(root.length)
} else if (
depsOptimizer?.isOptimizedDepFile(resolved.id) ||
fs.existsSync(cleanUrl(resolved.id))
(path.isAbsolute(cleanUrl(resolved.id)) &&
fs.existsSync(cleanUrl(resolved.id)))
) {
// an optimized deps may not yet exists in the filesystem, or
// a regular file exists but is out of root: rewrite to absolute /@fs/ paths
Expand Down

0 comments on commit 2a519a1

Please sign in to comment.