At the end of your SPA build process, you spin up a dummy HTTP server and run headless chromium on it (e.g. with puppeteer) to render each route and save the output html.
Instead of only /dist/index.html, you have /dist/index.html, /dist/about/index.html etc.