Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Update README: Add section on Server Side Rendering #85

wants to merge 1 commit into from

Conversation

limelights
Copy link

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.

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.
@limelights limelights changed the title Add section on Server Side Rendering Update README: Add section on Server Side Rendering Apr 27, 2019
@0gust1
Copy link

0gust1 commented May 19, 2019

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 README explaining that, and link to the compiler readme (for the compiler options).

Imho, explaining compiler's options in the loader's readme is not very sustainable and mixes concerns.

@AlbertMarashi
Copy link

AlbertMarashi commented May 18, 2020

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

@nergmada
Copy link
Contributor

nergmada commented May 27, 2020

Is the ability to include the options: { generate: 'ssr' } still available?

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',
Copy link
Member

@benmccann benmccann Jan 16, 2021

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

@benmccann
Copy link
Member

benmccann commented Jan 16, 2021

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

@benmccann
Copy link
Member

Added to the readme in #161

@benmccann benmccann closed this Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants