TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

fix(router-vite-plugin): use `cwd` instead of `vite.root` #1557

Closed a-maas closed 2 weeks ago

a-maas commented 2 weeks ago

fixes #1550.

Based on the issue, I was experiencing issues with the vite plugin generation not working when using a non-standard vite root configuration. This was caused by a mismatch between most of the code using ./ or process.cwd() as the relative root, and this line using vite.root.

I don't think vite's root config is strictly necessary here, because the TSR configuration already allows you to configure your routesDirectory and generatedRouteTree if using a non-standard directory structure.

nx-cloud[bot] commented 2 weeks ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9a12eca0a9bc5427b45b44e6b656f03e39e3b94f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx affected --targets=test:format,test:eslint,test:unit,test:build,build --parallel=3`](https://cloud.nx.app/runs/xlsZdGbWVO?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=test:types --exclude=examples/**`](https://cloud.nx.app/runs/tBTvL8QkcH?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.