From 7e0c44cd589137d2c3593b7776d98c5fb4d8b8f5 Mon Sep 17 00:00:00 2001 From: Tak Tran Date: Fri, 19 Jan 2024 17:39:14 +0000 Subject: [PATCH] Fix dot files not being copied over on non-root builds (#9740) When running `astro build` outside of where the astro files are, dotfiles are not copied over because the `includeDotfiles` parameter is not passed in. --- .changeset/slimy-jobs-smash.md | 5 +++++ packages/astro/src/core/build/static-build.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/slimy-jobs-smash.md diff --git a/.changeset/slimy-jobs-smash.md b/.changeset/slimy-jobs-smash.md new file mode 100644 index 000000000000..0ef5b290106d --- /dev/null +++ b/.changeset/slimy-jobs-smash.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fix dot files not being copied over on non-root builds diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 86b7740c4b64..c4ecfd6a2448 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -439,7 +439,7 @@ async function cleanServerOutput( // Clean out directly if the outDir is outside of root if (out.toString() !== opts.settings.config.outDir.toString()) { // Copy assets before cleaning directory if outside root - await copyFiles(out, opts.settings.config.outDir); + await copyFiles(out, opts.settings.config.outDir, true); await fs.promises.rm(out, { recursive: true }); return; }