Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: move up external url check before fs path checks #13639

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
)
}

if (isExternalUrl(resolved.id)) {
return [resolved.id, resolved.id]
}

const isRelative = url[0] === '.'
const isSelfImport = !isRelative && cleanUrl(url) === cleanUrl(importer)

Expand All @@ -349,10 +353,6 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
url = resolved.id
}

if (isExternalUrl(url)) {
return [url, url]
}

// if the resolved id is not a valid browser import specifier,
// prefix it to make it valid. We will strip this before feeding it
// back into the transform pipeline
Expand Down