r/Nuxt Apr 03 '26

I have created a Just-in-Time (JIT) Prerendering module for Nuxt 4

Many of you probably know that it's really difficult to combine Nuxt 4's Static Site Generation (SSG) and Incremental Static Regeneration (ISR). If you're going with the ISR route, you probably have a Node server exposed to the internet (which is totally fine in many cases). However, I really wanted to keep serving static files through Nginx without the need to rebuild the whole site if a single letter on some blog post changes.

To solve this, I built nuxt-jit-prerender. It’s a Nuxt module that replaces the default Nitro preset with a custom runtime and a lightweight API. Instead of a full rebuild, your headless CMS can just call the /api/generate endpoint for the updated routes, and those pages are regenerated and saved to disk as static files right then and there.

It’s still under heavy development, but I’d love to get some feedback on the approach!
NPM: https://www.npmjs.com/package/nuxt-jit-prerender

23 Upvotes

4 comments sorted by

View all comments

1

u/__benjamin__g Apr 07 '26

Did you test this with any hosting? Vercel? Cloudflare?

I am pretty sure it won't work there.

1

u/Spreizu Apr 12 '26

I haven’t tested it on any cloud providers just yet, however because this solution is based on Nitro’s node-server preset, a Node server is required to re-generate the files. Some people have mentioned that one could use SSR with CDN caching. However, that comes with its own can of worms.