0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

refactor(plugin-content): code refactor (#11312)

This commit is contained in:
Simon He 2024-06-25 21:32:31 +08:00 committed by GitHub
parent 86515f445e
commit 02c37c7b8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -508,11 +508,15 @@ export function pluginContent(
return;
}
// Cache build output of chunks and assets
const promises: Promise<void[] | undefined>[] = []
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)
},
},
};