You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Root route modulepreloads all route chunks in large projects (Vite 8 / Rolldown) #7197
In large projects, the root route ends up with all route chunks in its modulepreload list, which is inherited by every SSR'd page. For a 150+ route app this means 80–150+ <link rel="modulepreload"> tags on every server-rendered HTML response.
Context / motivation
I ran into this while looking at SSR HTML size. Every server-rendered page carried a large block of preload tags inherited from the root route, adding a few KB of inline path strings to the critical TTFB payload regardless of which page the user actually requested.
@schiller-manuel Sorry, the previous repro was AI-generated and I didn't review it carefully.
Updated it — no simulation needed, pnpm build triggers it naturally. Also verified on a production app (152 routes): root preloads 82 → 12 with the fix.
your PR does not fix the actual issue. it just prevents emitting the preloads. but the chunks will still be loaded via JS then.
So it's even worse now since this introduces a waterfall:
The actual issue is rolldown creating separate chunks for shared code between static and dynamic imports.
For context on the original motivation: I came at this from the SSR HTML size angle, not the loading angle. In our production app (152 routes), every server-rendered HTML response carried 80+ tags inherited by every page — a few KB on the critical TTFB payload I was trying to trim. Filtering at the manifest layer looked like a cheap local win, but as you pointed out, removing only the hint while leaving the static imports turns parallel discovery into a waterfall. Net loss.
Happy to follow rolldown#9154 and test against our app once it lands.
Activity
schiller-manuel commentedon Apr 16, 2026
please provide a reproducer project that actually exhibits this issue without having to simulate
ZacharyL2 commentedon Apr 17, 2026
@schiller-manuel Sorry, the previous repro was AI-generated and I didn't review it carefully.
Updated it — no simulation needed,
pnpm buildtriggers it naturally. Also verified on a production app (152 routes): root preloads 82 → 12 with the fix.schiller-manuel commentedon Apr 18, 2026
your PR does not fix the actual issue. it just prevents emitting the preloads. but the chunks will still be loaded via JS then.
So it's even worse now since this introduces a waterfall:
The actual issue is rolldown creating separate chunks for shared code between static and dynamic imports.
ZacharyL2 commentedon Apr 18, 2026
@schiller-manuel Thanks for tracking this upstream.
For context on the original motivation: I came at this from the SSR HTML size angle, not the loading angle. In our production app (152 routes), every server-rendered HTML response carried 80+ tags inherited by every page — a few KB on the critical TTFB payload I was trying to trim. Filtering at the manifest layer looked like a cheap local win, but as you pointed out, removing only the hint while leaving the static imports turns parallel discovery into a waterfall. Net loss.
Happy to follow rolldown#9154 and test against our app once it lands.
schiller-manuel commentedon Apr 18, 2026
this is already fixed in rolldown rc-16
vite is pinned to rc-15, so either override or wait for a new vite release