diff --git a/packages/astro/src/core/build/plugins/plugin-content.ts b/packages/astro/src/core/build/plugins/plugin-content.ts index 3f0da0d5f7..28000e7339 100644 --- a/packages/astro/src/core/build/plugins/plugin-content.ts +++ b/packages/astro/src/core/build/plugins/plugin-content.ts @@ -508,11 +508,15 @@ export function pluginContent( return; } // Cache build output of chunks and assets + const promises: Promise[] = [] for (const { cached, dist } of cachedBuildOutput) { if (fsMod.existsSync(dist)) { - await copyFiles(dist, cached, true); + promises.push(copyFiles(dist, cached, true)); } } + + if (promises.length) + await Promise.all(promises) }, }, };