Skip to content

Commit

Permalink
fix: skip optimization if no pkgId exists
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 17, 2022
1 parent 2b7b452 commit 85d90b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,10 @@ export function tryNodeResolve(
}

const skipOptimization =
!pkgId ||
!isJsType ||
importer?.includes('node_modules') ||
(pkgId && exclude?.includes(pkgId)) ||
exclude?.includes(pkgId) ||
exclude?.includes(nestedPath) ||
SPECIAL_QUERY_RE.test(resolved) ||
(!isBuild && ssr) ||
Expand Down

0 comments on commit 85d90b1

Please sign in to comment.