Skip to content

Commit

Permalink
Fix dot files not being copied over on non-root builds (#9740) (#9741)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
taktran and lilnasy committed Jan 22, 2024
1 parent 7356336 commit 73d7440
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-jobs-smash.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 73d7440

Please sign in to comment.