This is a minimal example project that demonstrates a potential bug with the TanStack Router Vite Plugin when using a non-standard vite root
configuration. In this example, the vite root
config is set to app
in the vite.config.ts
file. With this configuration, TanStack Router does not detect tsr.config.json
in the project root, but will detect it if the file is moved to the app
directory. Once moved to the app
directory, the TanStack Router Vite plugin will successfully generate the routes on vite dev
boot, but will not detect and re-generate based on adding and removing files in the app/routes
directory.
- Clone this repository
- Run
npm install
- Run
npm run dev
- Observe that the routes are generated on boot.
- Add a
test.tsx
file to theapp/routes
directory. - Observe that the routes are not re-generated.