Update README: Add section on Server Side Rendering#85
Update README: Add section on Server Side Rendering#85limelights wants to merge 1 commit intosveltejs:masterfrom limelights:patch-3
Conversation
Added a quick example on how to enable SSR in svelte-loader since documentation was missing this. It should ideally say what all values of `generate` do and how they work but `ssr` is the first value I stumbled upon.
|
All the options you pass to the loader, that are not in this list below, will be passed to the Svelte compiler. const pluginOptions = {
externalDependencies: true,
hotReload: true,
hotOptions: true,
preprocess: true,
emitCss: true,
// legacy
shared: true,
style: true,
script: true,
markup: true
};To make that more explicit, we could make a paragraph in the Imho, explaining compiler's options in the loader's readme is not very sustainable and mixes concerns. |
|
On another note regarding SSR documentation, I'm willing to create an extensive SSR guide (including support for code-splitting). To do code-splitting with SSR you need a client & server plugin, which I've built and happy to add to the svelte-loader core for anyone who wants first-class support for server-side rendering and preloading/prefetch of asynchronous scripts (for faster loading speeds) More information: #124 |
|
Is the ability to include the I read the note about mixing concerns and I agree but I think it might be worth a reference like "any options here will be passed to svelte.compile, see svelte.compile for more" then there's a sense of direction. Sorry don't need some rando's two cents, but there you go. |
| use: { | ||
| loader: 'svelte-loader', | ||
| options: { | ||
| generate: 'ssr', |
|
We should make these docs generically talk about the Svelte compiler options rather than just SSR specifically since there might be other options people would want to use as well - though we could use SSR in the example |
|
Added to the readme in #161 |
Added a quick example on how to enable SSR in svelte-loader since documentation was missing this.
It should ideally say what all values of
generatedo and how they work butssris the first value I stumbled upon.