Skip to content

Commit

Permalink
fix: apply SSR externalization heuristic to devDependencies (#4699)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Sep 1, 2021
1 parent c53f333 commit 0f1d6be
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/vite/src/node/ssr/ssrExternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ export function resolveSSRExternal(
return []
}
const pkg = JSON.parse(pkgContent)
const devDeps = Object.keys(pkg.devDependencies || {})
const importedDeps = knownImports.map(getNpmPackageName).filter(isDefined)
const deps = unique([...importedDeps, ...Object.keys(pkg.dependencies || {})])

for (const id of devDeps) {
ssrExternals.add(id)
seen.add(id)
}
const deps = unique([
...importedDeps,
...Object.keys(pkg.devDependencies || {}),
...Object.keys(pkg.dependencies || {})
])

const resolveOptions: InternalResolveOptions = {
root,
Expand Down

0 comments on commit 0f1d6be

Please sign in to comment.