T
TanStack2mo ago
conscious-sapphire

How to use Static Prerendering + SPA

I am working on a web app and it has some public pages that I want to prerender (like home page, terms & privacy policy, login page), and private pages that the user must login to access that I want to render as a SPA basically: ----------------------- | /index | | /login |__ Static Prerendering | /terms-of-service | | /privacy-policy | ----------------------- ----------------------- | /app/* |__ SPA ----------------------- how to properly configure it? the 'prerender.routes' options in vite.config.ts mentioned in the docs is not defined!
No description
2 Replies
absent-sapphire
absent-sapphire2mo ago
i want to add on to this: How to make any specific route completely static and rest can still have ssr and other functionality?
exotic-emerald
exotic-emerald2mo ago
you have to pass a pages array and for each path you want you enable prerender the top-level prerender is for default options

Did you find this page helpful?