Skip to content

Commit

Permalink
fix: revert #6251 (#6290)
Browse files Browse the repository at this point in the history
This reverts commit 49da986.
  • Loading branch information
antfu committed Dec 28, 2021
1 parent 1cbf0e1 commit 83ad7bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/vite/src/node/build.ts
Expand Up @@ -647,12 +647,12 @@ function getPkgName(root: string) {
function createMoveToVendorChunkFn(config: ResolvedConfig): GetManualChunk {
const cache = new Map<string, boolean>()
return (id, { getModuleInfo }) => {
if (id.includes('node_modules') && !isCSSRequest(id)) {
if (staticImportedByEntry(id, getModuleInfo, cache)) {
return 'vendor'
} else {
return 'async-vendor'
}
if (
id.includes('node_modules') &&
!isCSSRequest(id) &&
staticImportedByEntry(id, getModuleInfo, cache)
) {
return 'vendor'
}
}
}
Expand Down

0 comments on commit 83ad7bf

Please sign in to comment.