-
-
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
Strange naming of css files #7469
Comments
This is currently expected. We derive the CSS file name by the first name of a list of pages that uses it, e.g. if both I think it's somewhat possible to use the original file name, e.g. |
For now this is the only thing that feels wrong about Astro. This naming is very misleading and took me a while to investigate. Why would anyone want to call The same issue was simply closed as if it does not matter #5787 |
I agree. I thought something was broken since my css file was named after some random page despite being a global css file. It seems like it should ideally just be called the same name as the original file name (with a hash) or else it could confuse people. |
I agree the naming could be made better. However, it can't be the original file name because a chunk is often made by combining multiple files and sources. |
Please fix it, cause it feels so wrong and broken. |
Has this issue been fixed correctly? |
Same. So far, I'm aware of Rollup assetfilenames. But its cumbersome. |
Just encountered the same issue, if I may call it so, in Astro 4.5.2, was thinking I was doing something wrong. Would be good to somehow name the output file more appropriately by default |
same thing happend to me, it shouldn't merge them into one, keep them seperate chunks for each page to avoid Eliminate render-blocking resources issue. |
same issue :( |
I just created an integration for this: https://www.npmjs.com/package/astro-generic-build-filenames |
same issue after so long time. any updates? |
I just got confused by this issue. Would appreciate any of the suggestions made above. |
The current naming scheme is quite confusing when debugging style issues - I was chasing down a rabbit hole for a full day because of this. PR #8754 addressed some confusion (like "404" names), but the core issue of misnamed layout styles remains. Reproduction case of the current behavior in #13132. Thanks to @mschoeffmann - your integration improves the confusing names, but I also see from #334 that it should prevent deployment headaches on cloudflare. Might have saved me from running into that wall later. Since this naming problem continues to confuse new developers, it might be worth reconsidering closing issues when core problems remain unresolved. |
I agree with the naming. It's totally unexpected behaviour in my opinion. The production files should just fingerprint the it's the only weird thing about astro for now https://discord.com/channels/830184174198718474/1337533512391331982 |
What version of
astro
are you using?2.6.6
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
i use a
global.css
file in my layoutbase.astro
like this:i use this
base
layout in my two pagesindex.astro
andabout.astro
like this:when i build my simple site, i get the following css files:
index.[hash].css
- homepage stylesabout.[hash].css
- styles fromglobal.css
file, imported inbase.astro
about.[hash].css
- about page stylesit is a bit strange that i have two
about.[hash].css
files.What's the expected result?
i like that the css files are named according to the pages, but why are imported css files, like my
global.css
file not named according to their file name or the layout file name?i wan to get the following css files:
index.[hash].css
- homepage stylesglobal.[hash].css
orbase.[hash].css
- styles fromglobal.css
file, imported inbase.astro
about.[hash].css
- about page stylesLink to Minimal Reproducible Example
https://stackblitz.com/edit/github-wgxcan?file=src%2Fpages%2Fabout.astro
Participation
The text was updated successfully, but these errors were encountered: