Skip to content

Commit

Permalink
fix(esbuildDepPlugin): externalize built-in module during SSR (vitejs…
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 authored and aleclarson committed Nov 8, 2021
1 parent 0b6d54f commit 58a91cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/optimizer/esbuildDepPlugin.ts
Expand Up @@ -6,7 +6,8 @@ import {
isRunningWithYarnPnp,
flattenId,
normalizePath,
isExternalUrl
isExternalUrl,
isBuiltin
} from '../utils'
import { browserExternalId } from '../plugins/resolve'
import { ExportsData } from '.'
Expand Down Expand Up @@ -119,7 +120,7 @@ export function esbuildDepPlugin(
namespace: 'browser-external'
}
}
if (isExternalUrl(resolved)) {
if (isExternalUrl(resolved) || (ssr && isBuiltin(id))) {
return {
path: resolved,
external: true
Expand Down

0 comments on commit 58a91cd

Please sign in to comment.