Potential fix: change process.cwd() in this line
to viteConfig.root
I'm using React Router as a...
framework
Reproduction
Go here and run pnpm build, you'll see prerender route output to a wrong place
https://stackblitz.com/edit/github-7kwnry9f?file=home%2Fprojects%2Fgithub-7kwnry9f%2Fbuild%2Fclient%2Findex.html
System Info
Used Package Manager
pnpm
Expected Behavior
The file should be generated to build/client folder
Actual Behavior
The file was generated to current folder under a long path like: ./Users/user/react-router-project/build/client/index.html (note this is under current project directory