From 73d74402007896204ee965f6553dc83b3dec8d2f Mon Sep 17 00:00:00 2001 From: Tak Tran Date: Mon, 22 Jan 2024 12:07:59 +0000 Subject: [PATCH] Fix dot files not being copied over on non-root builds (#9740) (#9741) * 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. * update changeset * Update changeset description --------- Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com> --- .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 0000000000..d7c7611dbe --- /dev/null +++ b/.changeset/slimy-jobs-smash.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes an issue where dot files were not copied over from the public folder to the output folder, when build command was run in a folder other than the root of the project. diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 86b7740c4b..c4ecfd6a24 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; }