#How to stop vite from pre-fetching all components?

1 messages · Page 1 of 1 (latest)

safe hedge
#

When I accessing http://localhost:3000/, vite starts to fetch ALL components, even if the components are not related to the home page.
It tooke 12 seconds to all everything, everytime and before that is done, the page is blank.
How do I stop this from happening?

cloud escarp
#

Hmm that would be very weird of Vite. Can you give some more evidence - Why do you think so? Can you get a screenshot of your network request?

safe hedge
cloud escarp
#

Would you be able to share the Github repo or make a minimal reproduction repo so I can help take a further look

safe hedge
#

I found the culprint while I was preparing the minimal reproduction. it was because of tanstack.
As long as a component is defined in a route and the route is in the tree, it is getting fetched.

#

Should I still provide the repo?