Skip to content
Source
Sign inSign up
TanStack/router

Unnecessary CSS being imported #4396

Send to my agent
Openilarramendi(GitHub profile, opens in a new tab) opened this issue 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

Sign in to join this conversation.