-
-
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
Unnecessary CSS files in dist #8567
Comments
Hey @lilnasy I would like to give it a shot |
Thanks @pratik-codes |
To check this bug I wanted to reproduce this so I created a new astro project and did the same thing. But it wasn't creating an unnecessary css file in the dist folder. To be sure about it I removed all the CSS from the project and when built it didn't even create a CSS file. Attaching a screenshot above. @lilnasy I think there is no issue or do you think I am doing anything wrong here? |
That is probably a typo - |
@lilnasy correct I understood it was a typo. I tried npm run build only and it didn't generate anything when there was no CSS. I will also share a video for better understanding of this. |
This happens for me too when building the static page. The CSS in the extra file comes from a local Wouldn't it be generally better to use the separate CSS file instead of the inline CSS? When using a strong CSP header, inlining CSS is not allowed. Loading it from the same origin would be fine. |
Now it works as expected with Astro 3.2. Topic can be closed. |
I just updated my page to latest Astro (3.2.2) and I'm still getting both the inline <style> and the unused CSS file when building for static. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Not browser-related
Describe the Bug
When I update Astro from version 3.0.8 to 3.0.10, and running ´npm run build´, astro create unnecessary CSS files in dist folder. These files are still bundled in the latest version, but the CSS files were never assigned. It's definitely a bug.
Screenshot
https://ibb.co/bvrvD3D
Repo
https://github.com/artursopelnik/astro-demo
What's the expected result?
No unnecessary CSS files that are not included in the dist.
The text was updated successfully, but these errors were encountered: