Hacker News new | ask | show | jobs
by trinovantes 1875 days ago
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.

2 comments

Surely you meant this facetiously?
I think not, what he describes is really the way some of these tools work.
Why render headless and repackage the output though?
The main benefit is for SEO tags on each individual route and proper 404 status code
This seems... convoluted.
We, the people doing front-end, like to keep things exiting.