TanStackT
TanStack5w ago
1 reply
still-lime

basepath usage

I can't figure out how to use a custom basepath, I must be doing something wrong.

Currently, I'm doing the following:
1. In createRouter, set basepath to "./app"*
2. In
vite.config.ts
, set basepath to "./app"

I thought this should be it, but
routeTree.gen.ts
isn't updating its import paths to account for the new basepath. Also, creating new files under ./src/routes will result in codegen like before, but creating one under ./src/app/routes won't.

I'm either making some obvious mistake or there's something else wrong with my setup. If it's the former, please help; if it's the latter, I can provide more detail about the setup, or even a repro if needed.

---

* I've also tried "app" and "/app"
I've also tried setting generatedRouteTree: "app/routeTree.gen.ts" – this DOES put the routeTree in a different place, but it still imports from ./src/routes and never from ./src/app/routes
Was this page helpful?