Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.4k
Should routeTree.gen.ts be gitignored?#1218
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I belive it should be, but I want to hear what other people are doing. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
I've honestly gotten into the mindset of just saving yourroute-tree file in git. Purely, because the file is essential to your application running and having the typecheck phase pass correctly.
Updated Answer: Don't gitignore yourrouteTree.gen.ts file. This file is part of your application. It's simply managed by TanStack Router.
Replies: 3 comments 11 replies
-
If you are using router-cli you could probably This changes however if you are using the vite-plugin, since the default vite-build script has you run IMHO: I just check-in the file (routeTree.gen.ts) in git, because I can't be bothered solving the vite-build script. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I used theRouter CLI, created a |
BetaWas this translation helpful?Give feedback.
All reactions
-
@SeanCassiere has anything changed since the last year? Still the same guidance? |
BetaWas this translation helpful?Give feedback.
All reactions
-
I've honestly gotten into the mindset of just saving your Updated Answer: Don't gitignore your |
BetaWas this translation helpful?Give feedback.
All reactions
👍 5👎 1
-
I'll probably create a FAQ section and chuck this in there. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 2
-
FAQ would be nice! A counterpoint I can offer is that dependencies are also essential to your application running and would fail typecheck if not installed, yet we don't keep them in git. Even more similar, I work on codegen (see my profile) and the same question arises there. I went from yes to no on the same question. It's not that difficult to generate everything that's needed on |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
The FAQ is up -https://tanstack.com/router/latest/docs/framework/react/faq @mrlubos, I get what you mean. My only argument against the conflict point is, that this isn't like your |
BetaWas this translation helpful?Give feedback.
All reactions
👎 1❤️ 2
-
@SeanCassiere please update the same over here as well -https://tanstack.com/start/latest/docs/framework/react/guide/routing#:~:text=You%20may%20gitignore%20this%20file%2C%20since%20it%20is%20a%20build%20artifact. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I'm using GitHub Actions so I just had to add:```- name: Generate routes file run: | docker compose run --rm --no-deps react npm run router:generate``` …On Wed, Apr 24, 2024, at 8:54 AM, HappilyCoding wrote:> I used the Router CLI <https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing#router-cli>, created a `"router:generate": "tsr generate",` in the `package.json` so I can use it in my build process.> Could you please explain further? You probably modified other parts of the package.json or the docker or dockercompose files in order for tsr generate to be called automatically in the build process. It'd be awesome if you could share those changes. Also, to be frank, I'm unsure why tsr CLI is needed at all, according to the official doccumentation <https://tanstack.com/router/v1/docs/framework/react/quick-start> I don't believe it should be, specially considering since that's basically the configuration this project has. — Reply to this email directly, view it on GitHub <#1218 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAMS7NRIPY654RAYUIGO2JDY67BTTAVCNFSM6AAAAABDX27WTOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEMJUG4ZDS>. You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.
All reactions
-
tsc is just a compile check so I moved it after the build: "build":"vite build && tsc" |
BetaWas this translation helpful?Give feedback.
All reactions
-
What's the point of building if typecheck failed? It should ideally be "build":"tsc --noEmit && vite build" |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1👎 2
-
The point is that tsc will always fail if there's no generated route-tree file, which I have git ignored. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 4