Different code splitting behavior when using `autoCodeSplitting: true` vs splitting with .lazy.tsx
I was looking at my bundle and noticed that a dependency that is used in a route was included in the main bundle. I have
autoCodeSplitting: true so I would expect it to be split into a separate route, but unless I manually split the route using .lazy.tsx, it gets included in the main bundle when built. Am I misunderstanding how auto codesplitting is supposed to work?4 Replies
adverse-sapphire•3mo ago
.lazy is not required for autoCodeSplitting
can you provide a complete example project ?
eager-peachOP•3mo ago
I realized the cause, we had set
enableRouteGeneration: command === 'serve', in order to make it not regenerate the routes when building (the assumption being that the routes had been generated and shouldn't be changing during builds), removing this fixed itadverse-sapphire•3mo ago
hm can you please create a github issue for this? code splitting should still work even with enableRouteGenerator = false
eager-peachOP•3mo ago
Sure, I created one