Skip to content

Prerender landing page in SPA mode #9719

Answered by geoffrich
pietz asked this question in Q&A
Discussion options

You must be logged in to vote

If you only want to prerender your landing page, then I suggest:

  • ssr=false in your root +layout.js (disable SSR for the whole site)
  • prerender=true and ssr=true in your root +page.js (corresponding to the landing page). This will only prerender (and SSR) the landing page. Note that you do need ssr enabled if you want the prerendered page to contain the page's HTML - without enabling SSR, prerendering the page will output an empty shell.

In SvelteKit terms, prerender only controls whether an HTML file is created for the page at build time. You also need to enable ssr if you want that HTML file to contain the +page.svelte's corresponding HTML. Since the page is prerendered, ssr means the s…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ChandanMahapatra
Comment options

@eltigerchino
Comment options

Answer selected by eltigerchino
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants