router icon indicating copy to clipboard operation
router copied to clipboard

Unnecessary CSS being imported

Open ilarramendi opened this issue 7 months ago • 0 comments

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:

  1. Add a new css file
  2. Import that file from any route with a normal import, not using ?url
  3. Create a production build (also happens in dev)
  4. 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.

Image

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

ilarramendi avatar Jun 11 '25 22:06 ilarramendi