Replies: 1 comment 2 replies
-
We currently don't have a "nice" way of "grouping chunks", but we are looking into this. However, I think you can use manual chunks already today. The following should create two bundles, one for the export default defineConfig({
plugins: [
TanStackRouterVite({
autoCodeSplitting: true,
}),
react(),
],
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('users') && id.includes('?tsr-split')) {
return 'users'
}
return 'other'
},
},
},
},
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently every route becomes it's own chunk. I would like to have a set of lazy routes become a single chunk.
I could do manual chunks, but the file names of the chunks don't have enough information for me to determine which route generated the chunk.
Given this setup:
I would like an easy way to make everything under /user/ become a single chunk.
The benefit would be that you only load the modules you enter, but once you enter a module, you don't need to wait for every single route to load when navigating.
Beta Was this translation helpful? Give feedback.
All reactions