Skip to content

Commit

Permalink
fix: rewrite file URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 29, 2024
1 parent 9cd287a commit 062908a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
// If resolvable, let's resolve it
if (specifier !== undefined) {
// skip external / data uri
if (isExternalUrl(specifier) || isDataUrl(specifier)) {
if (
(isExternalUrl(specifier) && !specifier.startsWith('file://')) ||
isDataUrl(specifier)
) {
return
}
// skip ssr externals and builtins
Expand Down

0 comments on commit 062908a

Please sign in to comment.