Skip to content

akaSybe/svelte-prerender-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerender Svelte app at build-time

⚠️ I'd recommend you to use rollup-plugin-svelte-ssr instead. It uses the same approach but it's easier to use.

This is an example how to prerender Svelte app

Get started

Install the dependencies

npm install

Build

npm run build

Run

npm run serve

Navigate to localhost:5000. You should see your app running

How it works

Rollup config consists of two separate configs:

The first config used to build usual iife bundle with app.

The second config used to build root component as SSR component. When SSR component bundled, Rollup executes script prerender.js, which uses SSR Component API to get HTML and CSS.

Remarks

It's experimental example. Maybe there is a more simple way.

Releases

No releases published

Packages

No packages published