Skip to content

Commit

Permalink
fix: properly externalize resolved external urls
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 13, 2021
1 parent fe3ac2c commit 6cda88d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vite/src/node/plugins/importAnalysis.ts
Expand Up @@ -182,14 +182,14 @@ 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
if (
!url.startsWith('.') &&
!url.startsWith('/') &&
!isExternalUrl(url)
) {
if (!url.startsWith('.') && !url.startsWith('/')) {
url =
VALID_ID_PREFIX + resolved.id.replace('\0', NULL_BYTE_PLACEHOLDER)
}
Expand Down

0 comments on commit 6cda88d

Please sign in to comment.