Skip to content
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

No builtin Astro approach to move files to the root of the dist folder. #5245

Closed
1 task done
awwong1 opened this issue Oct 28, 2022 · 2 comments
Closed
1 task done
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@awwong1
Copy link

awwong1 commented Oct 28, 2022

What version of astro are you using?

1.5.2

Are you using an SSR adapter? If so, which one?

Cloudflare

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

See also Discord support thread: https://discord.com/channels/830184174198718474/1032513921153761330

Can a file (e.g. _redirects ) be moved into the dist folder on npx astro build?

If I have this file within public, it gets put into dist/static.

If I create this file manually, it is overwritten on each build.

This is necessary for Cloudflare Pages redirects.
https://developers.cloudflare.com/pages/platform/redirects

Thanks!

Link to Minimal Reproducible Example

https://github.com/udiaca/u0.vc

Participation

  • I am willing to submit a pull request for this issue.
@awwong1 awwong1 changed the title No builtin Astro approach move files to the root of the dist folder. No builtin Astro approach to move files to the root of the dist folder. Oct 28, 2022
@matthewp
Copy link
Contributor

So I guess this is happening because the Cloudflare adapter sets up the dist/static folder here: https://github.com/withastro/astro/blob/main/packages/integrations/cloudflare/src/index.ts#L48

If _redirects is a special Cloudflare thing maybe it should support that file directly?

@matthewp
Copy link
Contributor

Fixed by #5347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

2 participants