0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Fix static build when out dir is not within the cwd (#9378)

* Fix static build when out dir is not within the cwd

* Create lorem-ipsum-dolor

Changeset
This commit is contained in:
Jacob Parker 2023-12-13 15:17:10 +00:00 committed by GitHub
parent f8b27b07c0
commit 8c9fe0092a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes static builds when `config.outDir` is located outside of the astro project

View file

@ -352,7 +352,7 @@ async function runPostBuildHooks(
? mutation.targets.includes('server') ? mutation.targets.includes('server')
? build.server ? build.server
: build.client : build.client
: config.outDir; : getOutDirWithinCwd(config.outDir);
const fullPath = path.join(fileURLToPath(root), fileName); const fullPath = path.join(fileURLToPath(root), fileName);
const fileURL = pathToFileURL(fullPath); const fileURL = pathToFileURL(fullPath);
await fs.promises.mkdir(new URL('./', fileURL), { recursive: true }); await fs.promises.mkdir(new URL('./', fileURL), { recursive: true });