rollup-plugin-svelte-ssr
Server-side rendering of Svelte app at build-time using Rollup plugin
Basic example
Let's assume that we have basic svelte component src/App.svelte
:
<script> export let name;</script> <div>{name}</div> <style> div { color: red; }</style>
Let's use rollup-plugin-svelte-ssr
in rollup.config.js
:
// ... other imports ; input: "src/App.svelte" output: format: "cjs" file: "dist/ssr.js" plugins: // ... other plugins
In dist
directory we get ssr.html
that contains SSR-ed app:
Hello
Options