TanStack Router: How to ignore files and folders from the route generation
17 July 2026 (Updated 17 July 2026)
To ignore a file or folder from being included in the generated route tree file (routeTree.gen.ts), you can give them the - prefix.
For example, you can do something like this:
routes/
├── posts.tsx
├── -posts-table.tsx // 👈🏼 ignored
├── -components/ // 👈🏼 ignored
│ ├── header.tsx // 👈🏼 ignored
│ ├── footer.tsx // 👈🏼 ignored
│ ├── ...
Tagged:
TanStack Router recipes