Prerender Page In Svelte Kit

In this article, you will learn How To Prerender Page In Svelte Kit. Prerendering Page To prerender the page you have to add a script…

The post Prerender Page In Svelte Kit appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Jatin Hemnani

In this article, you will learn How To Prerender Page In Svelte Kit.

Prerendering Page

To prerender the page you have to add a script tag with context of module.

<script context="module">
	export const prerender = true;
</script>

In this way, Svelte Kit will know which page to prerender. Prerendering will generate HTML files at the build time.

Result

Above you can see the index.html file inside the about folder.

The post Prerender Page In Svelte Kit appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Jatin Hemnani


Print Share Comment Cite Upload Translate Updates
APA

Jatin Hemnani | Sciencx (2021-06-29T08:47:52+00:00) Prerender Page In Svelte Kit. Retrieved from https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/

MLA
" » Prerender Page In Svelte Kit." Jatin Hemnani | Sciencx - Tuesday June 29, 2021, https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/
HARVARD
Jatin Hemnani | Sciencx Tuesday June 29, 2021 » Prerender Page In Svelte Kit., viewed ,<https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/>
VANCOUVER
Jatin Hemnani | Sciencx - » Prerender Page In Svelte Kit. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/
CHICAGO
" » Prerender Page In Svelte Kit." Jatin Hemnani | Sciencx - Accessed . https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/
IEEE
" » Prerender Page In Svelte Kit." Jatin Hemnani | Sciencx [Online]. Available: https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/. [Accessed: ]
rf:citation
» Prerender Page In Svelte Kit | Jatin Hemnani | Sciencx | https://www.scien.cx/2021/06/29/prerender-page-in-svelte-kit/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.