Should routeTree.gen.ts be gitignored? #1218
-
I belive it should be, but I want to hear what other people are doing. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 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. |
Beta Was this translation helpful? Give feedback.
-
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: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
tsc is just a compile check so I moved it after the build: "build": "vite build && tsc" |
Beta Was this translation helpful? Give feedback.
I've honestly gotten into the mindset of just saving your
route-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 your
routeTree.gen.ts
file. This file is part of your application. It's simply managed by TanStack Router.