Skip to content

Commit

Permalink
fix: ssr.external/noExternal should apply to packageName (#9146)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jul 15, 2022
1 parent 5ea70b3 commit 5844d8e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite/src/node/ssr/ssrExternal.ts
Expand Up @@ -120,13 +120,17 @@ export function createIsConfiguredAsSsrExternal(
return (id: string) => {
const { ssr } = config
if (ssr) {
if (ssr.external?.includes(id)) {
const pkgName = getNpmPackageName(id)
if (!pkgName) {
return undefined
}
if (ssr.external?.includes(pkgName)) {
return true
}
if (typeof noExternal === 'boolean') {
return !noExternal
}
if (noExternalFilter && !noExternalFilter(id)) {
if (noExternalFilter && !noExternalFilter(pkgName)) {
return false
}
}
Expand Down

0 comments on commit 5844d8e

Please sign in to comment.