Skip to content

Commit

Permalink
fix: patch static build regression (#5644)
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Moore <nate@astro.build>
  • Loading branch information
natemoo-re and natemoo-re committed Dec 19, 2022
1 parent 62580ed commit d5aff85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-camels-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix static build regression where chunks would not be generated
4 changes: 3 additions & 1 deletion packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down

0 comments on commit d5aff85

Please sign in to comment.