-
-
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
Hashed build assets end up in multiple places in build output #5502
Comments
I want to try fix this bug |
I think that’s one option, sure — or just move the contents of |
let me try to move all to the |
I have tried these files moving But following your said method that doesn't move the CSS bundle file. |
* feat: change path * feat: fix bug #5502 * fix: astro fix to patch * feat: change to major * chore: update changelog * fix: change entryFileNames into assets folder * fix: fix error message in test Co-authored-by: bluwy <[email protected]>
Fixed in 2.0 with the |
What version of
astro
are you using?1.6.12
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
macOS / Stackblitz
Describe the Bug
Astro outputs various assets from its build and adds a hash to the file names to help with immutable caching. Currently these end up in various places making it less simple than it could be to set up cache headers for static builds:
dist/assets/<name>.<hash>.css
<style>
tags or imported as ES modulesdist/chunks/<name>.<hash>.js
canvas-confetti
in this repro)dist/hoisted.<hash>.js
(alsodist/client.<hash>.js
?)vite.build.assetsInlineLimit
)dist/<ComponentName>.<hash>.js
Proposal here is to move these all under
assets/
so that caching is simpler to set up. Vercel automatically setsimmutable
cache headers for theassets/
folder of static Astro sites, so this would also ensure their default set-up covers everything.Alternative would be to make PRs to Vercel and other providers for a more complex immutable caching set-up.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-p5qbcj?file=src/pages/index.astro
Participation
The text was updated successfully, but these errors were encountered: