-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README: Add section on Server Side Rendering #85
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've moved this under compilerOptions
in #159
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
generate
do and how they work butssr
is the first value I stumbled upon.