fix: patch static build regression (#5644)
Co-authored-by: Nate Moore <nate@astro.build>
This commit is contained in:
parent
62580ed078
commit
d5aff85db4
2 changed files with 8 additions and 1 deletions
5
.changeset/small-camels-mix.md
Normal file
5
.changeset/small-camels-mix.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix static build regression where chunks would not be generated
|
|
@ -362,7 +362,9 @@ async function cleanServerOutput(opts: StaticBuildOptions) {
|
|||
await Promise.all(
|
||||
Array.from(directories).map(async (filename) => {
|
||||
const url = new URL(filename, out);
|
||||
const dir = await glob(fileURLToPath(url), { absolute: true });
|
||||
const dir = await glob(fileURLToPath(url));
|
||||
// Do not delete chunks/ directory!
|
||||
if (filename === 'chunks') return;
|
||||
if (!dir.length) {
|
||||
await fs.promises.rm(url, { recursive: true, force: true });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue