That’s a great question! the issue is the same with an SPA regardless of where you host it since all requests are passed to the router. If you know all your routes then you can use netlify
_redirects to send those specific routes that are used to your index.html, and all others can be handled with a 404 failover rule. Since the
_redirects file needs to be there at the end of the build, you can generate a
_redirects file based on your routes programmatically during the build process. That said, I don’t know anyone that does this. Google’s crawlers in theory are able to crawl SPA’s, but I don’t know how well that works, and anecdotally speaking , prerendering the page will still give you better results.
Or you can use a static site generator like Gatsby/React-Static or Gridsome/Nuxt (if you already use React or Vue)