-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dot files not copied over from public
folder if not running build from root folder
#9740
Comments
Oh, I checked out the stackblitz (https://stackblitz.com/edit/github-es2mdg-rajrjb) that was working locally, and looked at However, although I'm not able to replicate atm, the code still does seem like there's an issue here in situations where the out folders are different. [Edit: clear up nx setup] |
Thanks for looking into it. Even from a different folder, I could not reproduce the issue. video.mp4 |
Hello @taktran. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@lilnasy, actually when you run See https://stackblitz.com/edit/github-es2mdg-xzyijr Steps to reproduce
|
Actually my initial assumption that it was related to the |
public
folder in build if outDir
is setpublic
folder if not running build from root folder
When running `astro build` outside of where the astro files are, dotfiles are not copied over because the `includeDotfiles` parameter is not passed in.
When running `astro build` outside of where the astro files are, dotfiles are not copied over because the `includeDotfiles` parameter is not passed in.
You seem to have identified the right place for the fix from the PR you linked. A PR would be welcome. Feel free to ask if you want pointers. |
* 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 <[email protected]>
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have a
public/.htaccess
file and when runningastro build
, it doesn't get copied over to the dist folder. I also have a customoutDir
set to something like../../dist/packages/folder
.The strange thing is, I can't quite replicate it on stackblitz. This is my attempt, where the(it can be reproduced when run from another directory - see stackblitz below).htaccess
does get generated when you runnpm run build
in the terminal: https://stackblitz.com/edit/github-es2mdg-rajrjb?file=README.mdHowever, looking at the code and patching the file locally, it does fix it on my local machine:
https://github.com/withastro/astro/blob/main/packages/astro/src/core/build/static-build.ts#L439-L445
From
it looks like
copyFiles
should setincludedDotfiles
parameter to true ie,The
out.toString() !== opts.settings.config.outDir.toString()
check seems to match with my scenario whereoutDir
is set, and I can't think of a reason why it wouldn't copy dot files (or a least make it configurable somewhere).The
includedDotfiles
parameter seems to have been added in #5832, if that is useful.Am I missing something?
What's the expected result?
Expect
.htaccess
to appear in the dist folder when runningastro build
.Don't see the bug in the attached stackblitz, but can replicate locally and looking at the code, it does seem like it's a legitimate bug.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-es2mdg-rajrjb (not a reproducible example, but it's the gist of the steps - see above)https://stackblitz.com/edit/github-es2mdg-xzyijr?file=README.md (actual reproducible example)
Participation
The text was updated successfully, but these errors were encountered: