T
TanStack8mo ago
correct-apricot

All child routes in a single bundle?

Is it possible to include all child routes code in a single bundle. The generated bundle files for child routes are very small in size.
5 Replies
helpful-purple
helpful-purple8mo ago
At the moment no. Currently, when using automaticCodeSplitting, it splits each route by its Route content (loader and component). It's done this way so that the initial bundle size on the users device is very low and it only requests the Route content when required.
correct-apricot
correct-apricotOP8mo ago
@Tanner Linsley Any plans of adding this functionality?
helpful-purple
helpful-purple8mo ago
You could just turn off "automaticCodeSplitting" or not using the legacy .lazy syntax. This'd bunch all of the code into a single bundle.
correct-apricot
correct-apricotOP8mo ago
I still want to utilize code splitting but instead of ending up with tens of small bundles it will be better if we have the ability to group related code into one bundle. Few years back i did similar to this in vue

Did you find this page helpful?