diff --git a/.changeset/slimy-jobs-smash.md b/.changeset/slimy-jobs-smash.md new file mode 100644 index 000000000000..d7c7611dbe27 --- /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 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; }