Pre-rendering dynamic HTML from a shared folder using Angular SSG
I'm trying to pre-render dynamic HTML pages in an Angular app using SSG. These pages are not components themselves, but HTML files I fetch from an external project folder using HttpClient. I have a reusable component that handles rendering the HTML in the route like some-url/:id
The problem is that SSG won't work with HTTP requests, so these pages aren’t pre-rendered. I tried replacing the HTTP client with a Node.js function using fs.readFileSync during build to read the HTML files locally. I also configured dynamic routes so that prerendering knows all routes and can pull the right files. But it still doesn’t work. Index.html files are created, but the content wasn't prerendered.
Is there a way to pre-render HTML files from a local folder using Angular SSG?
I know Angular SSR can do this, but it requires a server in production, which would increase hosting costs. Using SSG is a higher priority for me
Posted Dec 4, 2025, 9:47 PM UTC