You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v3.0.13
Node v18.17.1
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/node
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When tailwind is installed and a 404.astro page is present, the build version of the project will always include the CSS files from the 404 page in all the pages. Depending on the file size of 404's CSS, this can have a downstream effect on load performance
When visiting /, I don't think stylesheets related to 404.css should be imported.
I've noticed that this could also happened to nested 404 pages, though i'm unable to replicate it in the sandbox
What's the expected result?
Stylesheet related to 404 shouldn't be imported when visiting normal pages.
This is expected behavior, when CSS is bundled into a file it is named after the first page it is used on and the tailwind integration injects styles onto every page by default so 404 is the first page alphabetically.
If you want more control over the naming of the output files you can configure rollup inside the Astro config:
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When tailwind is installed and a
404.astro
page is present, the build version of the project will always include the CSS files from the 404 page in all the pages. Depending on the file size of404
's CSS, this can have a downstream effect on load performanceWhen visiting
/
, I don't think stylesheets related to404.css
should be imported.I've noticed that this could also happened to nested 404 pages, though i'm unable to replicate it in the sandbox
What's the expected result?
Stylesheet related to 404 shouldn't be imported when visiting normal pages.
Link to Minimal Reproducible Example
https://codesandbox.io/p/sandbox/withered-snowflake-zmv8rm?file=/src/pages/nested/404.astro:9,1
Participation
The text was updated successfully, but these errors were encountered: