diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 51e3f530d39d19..629f7fd8e10a6d 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -284,7 +284,7 @@ export async function build( } finally { parallelCallCounts-- if (parallelCallCounts <= 0) { - paralellBuilds.forEach((bundle) => bundle.close()) + await Promise.all(paralellBuilds.map((bundle) => bundle.close())) paralellBuilds.length = 0 } }