router
router copied to clipboard
Unnecessary CSS being imported
Which project does this relate to?
Start
Describe the bug
When using normal css imports or css modules, css from other routes is requested on the page load
Your Example Website or App
https://codesandbox.io/p/devbox/smoosh-platform-5ws8gt?workspaceId=ws_KBZbFGeuhMkBGc8o1kN3wx
Steps to Reproduce the Bug or Issue
From start basic example:
- Add a new css file
- Import that file from any route with a normal import, not using
?url - Create a production build (also happens in dev)
- Load the home page, here you can see that both css files are requested, and the newly created css file should only be requested in its own page, or on link hover.
this is demostrated in the codesandbox example
Expected behavior
Only the css file being used in that specific route being requested (only in users in this example)
Screenshots or Videos
No response
Platform
- OS:any
- Browser: any
- Version: latest
Additional context
No response