diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index e64cc618135bb0..e5b51ec92be040 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -647,12 +647,12 @@ function getPkgName(root: string) { function createMoveToVendorChunkFn(config: ResolvedConfig): GetManualChunk { const cache = new Map() 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' + } } } }