So you're using React Router 7 in Framework Mode and via following this document -> https://reactrouter.com/how-to/spa#single-page-app-spa ?
Perhaps using Data Mode and then just modifying Vite initial start point (index.html) should be fine?
I am assuming you have an index.html on root, where then is something defined like this:
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Where root is the entry point of the app, can't you modify this file for what you need?