diff options
author | 2022-12-19 10:23:57 -0500 | |
---|---|---|
committer | 2022-12-19 09:23:57 -0600 | |
commit | d5aff85db48ccc9234968071b378829369afba9b (patch) | |
tree | 9925fe65eb7789be4a86e7ddc0f9121ffc02760e | |
parent | 62580ed07871606c88051b6a2007b865c636107e (diff) | |
download | astro-d5aff85db48ccc9234968071b378829369afba9b.tar.gz astro-d5aff85db48ccc9234968071b378829369afba9b.tar.zst astro-d5aff85db48ccc9234968071b378829369afba9b.zip |
fix: patch static build regression (#5644)
Co-authored-by: Nate Moore <nate@astro.build>
-rw-r--r-- | .changeset/small-camels-mix.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/static-build.ts | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.changeset/small-camels-mix.md b/.changeset/small-camels-mix.md new file mode 100644 index 000000000..99aaa8b72 --- /dev/null +++ b/.changeset/small-camels-mix.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix static build regression where chunks would not be generated diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 337730747..c44858f74 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -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 }); } |