Use the Tanstack Router CLI directly in Vite.
import { defineConfig } from "vite"
import react from "vite-plugin-"
import router from "vite-plugin-tsr-cli";
export default defineConfig({
plugins: [react(), router()]
})
The default route directory is ./src/routes
with the generated file living at ./src/routes.gen.ts
.
The available plugin options are the same as the CLI Options, and can be defined in the vite config or in a tsr.config.json
file in the root directory. Settings defined in the file take precedence over those defined in the vite config.
Made with 💚
Published under MIT License.