Svelte: Documentation#Getting started. Missing some stuff.

Created on 5 Jan 2018  Â·  3Comments  Â·  Source: sveltejs/svelte


https://svelte.technology/guide#getting-started
It seems that the Getting started are a tad too far on the lean side.

  • svelte-clihas in implicit dependency to the svelte module so it needs to be installed as well, at leas on windows, or svelte-cli is not working.
  • when you follow the steps with the compile and index html you get an empty web page with an app object that possible is a svelte component. Nothing is added to the DOM as it seems. Is this intended? Again, this is on windows.
  • also, I'm not seeing something like compiling multiple files

It is a bit said to have a 'Getting started' section be the first show stopper in looking into svelte.

help wanted

Most helpful comment

Until version 2, svelte-cli had svelte as a dependency, but that caused problems with people who had svelte-cli installed locally to their project but wanted to use a specific (i.e. the latest) version of svelte, without having to keep removing their node_modules and lock files.

So for v2 (released the other day), it was moved to peerDependencies... but that turns out to be worse, because it's likely you have the CLI installed globally which means it may not be able to find svelte. Honestly not sure what the right approach is.

@PaulMaly is right, you're much better off using a build tool with a plugin. I recommend starting here: https://svelte.technology/blog/the-easiest-way-to-get-started

You're entirely correct, our onboarding needs to improve. This is how these things evolve — you write a proof-of-concept CLI, then the first draft of the docs, then you start building the tools you really want, and write a blog post about it... and all along the out of date docs are just sitting there until someone comes along and points out how bad they are! We'll fix it.

All 3 comments

Don't use svelte-cli manually. Use webpack or rollup plugins instead.

Until version 2, svelte-cli had svelte as a dependency, but that caused problems with people who had svelte-cli installed locally to their project but wanted to use a specific (i.e. the latest) version of svelte, without having to keep removing their node_modules and lock files.

So for v2 (released the other day), it was moved to peerDependencies... but that turns out to be worse, because it's likely you have the CLI installed globally which means it may not be able to find svelte. Honestly not sure what the right approach is.

@PaulMaly is right, you're much better off using a build tool with a plugin. I recommend starting here: https://svelte.technology/blog/the-easiest-way-to-get-started

You're entirely correct, our onboarding needs to improve. This is how these things evolve — you write a proof-of-concept CLI, then the first draft of the docs, then you start building the tools you really want, and write a blog post about it... and all along the out of date docs are just sitting there until someone comes along and points out how bad they are! We'll fix it.

I'll close this as there aren't any specific action points — there are plenty of issues on the docs repo already, and the svelte-cli bug is long fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matt3224 picture matt3224  Â·  3Comments

AntoninBeaufort picture AntoninBeaufort  Â·  3Comments

juniorsd picture juniorsd  Â·  3Comments

Rich-Harris picture Rich-Harris  Â·  3Comments

1u0n picture 1u0n  Â·  3Comments