T
TanStack4mo ago
rising-crimson

Bundle splitting

Hi! I'm switching from using just @tanstack/router to the @tanstack/start alpha, and I'm noticing a layout shift (elements jumping) on initial render. After investigating, I found that it's due to each CSS file being split into its own output — even for routes that aren't lazy-loaded. I'm using CSS modules, and I noticed this behavior affects them too. To address this, I disabled auto code splitting in my Vite config like so:
tanstackStart({
tsr: {
autoCodeSplitting: false
}
})
tanstackStart({
tsr: {
autoCodeSplitting: false
}
})
I expected that this would include the CSS/JS for non-lazy routes in the main bundle (as it did with tanstack router alone), but that doesn't seem to be happening. For reference, I'm using the following versions:
"@tanstack/react-router": "1.120.4-alpha.15",
"@tanstack/react-router-with-query": "1.120.4-alpha.15",
"@tanstack/react-start": "1.120.4-alpha.17",
"@tanstack/react-router": "1.120.4-alpha.15",
"@tanstack/react-router-with-query": "1.120.4-alpha.15",
"@tanstack/react-start": "1.120.4-alpha.17",
Any insight on this behavior would be appreciated!
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?