Automatic Code Splitting with separate component file.
I wasn't able to find a clear answer in the docs relating to automatic code splitting and having the component in a separate file. I know it says not to use the .lazy suffix with automatic code splitting, but how will code splitting be affected if the component is in a separate regular file that doesnt have the .lazy prefix and is then imported into the route? Thanks!
3 Replies
correct-apricot•12mo ago
this is well supported
adverse-sapphireOP•12mo ago
awesome thanks for the quick reply!
correct-apricot•12mo ago
see this test
https://github.com/TanStack/router/blob/main/packages/router-plugin/tests/code-splitter/test-files/imported.tsx
result
https://github.com/TanStack/router/blob/main/packages/router-plugin/tests/code-splitter/snapshots/imported.tsx
https://github.com/TanStack/router/blob/main/packages/router-plugin/tests/code-splitter/snapshots/imported%40split.tsx
GitHub
router/packages/router-plugin/tests/code-splitter/test-files/import...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
GitHub
router/packages/router-plugin/tests/code-splitter/snapshots/importe...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
GitHub
router/packages/router-plugin/tests/code-splitter/snapshots/importe...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router