Skip to content

Commit

Permalink
fix: seperate source and dep for dymamic import after build (vitejs#6251
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sanyuan0704 authored Dec 27, 2021
1 parent 394539c commit 49da986
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
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) &&
staticImportedByEntry(id, getModuleInfo, cache)
) {
return 'vendor'
if (id.includes('node_modules') && !isCSSRequest(id)) {
if (staticImportedByEntry(id, getModuleInfo, cache)) {
return 'vendor'
} else {
return 'async-vendor'
}
}
}
}
Expand Down

0 comments on commit 49da986

Please sign in to comment.