Why should we commit routeTree.gen.ts into git?
https://tanstack.com/router/latest/docs/framework/react/faq#should-i-commit-my-routetreegents-file-into-git
According to this FAQ , it is advised to commit routeTree.gen.ts into git.
But why do we need to do that? I noticed that if we're using Vite, the routeTree.gen.ts will immediately be generated when starting dev mode so if other developers cloned our project and wants to work on it, they should have no issue generating the routeTree.gen.ts.
As for deployment, the routeTree.gen.ts will also be generated during build so if our CI/CD is building the app, then I don't see any issue there as well.
So what is the reason it is recommended to commit it?
According to this FAQ , it is advised to commit routeTree.gen.ts into git.
But why do we need to do that? I noticed that if we're using Vite, the routeTree.gen.ts will immediately be generated when starting dev mode so if other developers cloned our project and wants to work on it, they should have no issue generating the routeTree.gen.ts.
As for deployment, the routeTree.gen.ts will also be generated during build so if our CI/CD is building the app, then I don't see any issue there as well.
So what is the reason it is recommended to commit it?
Welcome to the TanStack Router FAQ! Here you'll find answers to common questions about the TanStack Router. If you have a question that isn't answered here, please feel free to ask in the . Why should...