Frequently Asked Questions

  Sapper is not 1.0 yet. Should I use it? What about SvelteKit?

We are currently working on Sapper's successor, SvelteKit. There are still some known issues to resolve and aspects of the design that will change. Whether you want to start on SvelteKit will be determined by how willing you are to deal with bumps in the road during a beta period. If you want to evaluate starting on the more stable Sapper project and then migrating to SvelteKit, please see the migration guide for details of what's necessary to do that.

Sapper is operationally stable and some of the Svelte maintainers run their businesses on Sapper. "production readiness" is subjective, and if Sapper fulfils your requirements, then it's production ready. As with any software, a major version number is not an indicator of whether something is suitable for your specific use-case.

  Should I use Webpack or Rollup with Sapper?

Sapper offers both Rollup and Webpack templates. If you don't have a strong reason to prefer one over the other, we'd recommend using the Rollup template. The Rollup implementation supports additional features such as improved tree-shaking for smaller bundles, TypeScript, the ability to serve a legacy bundle to older browsers, and it automatically lists all your .js and .css files in the Link header to preload those files.

  How do I use TypeScript with Sapper?

The Sapper template project with Rollup (see Getting started) can be converted to TypeScript by running:

node scripts/setupTypeScript.js

You can also find a number of community templates that utilize TypeScript.

  Why is there a node_modules folder in the src folder of a Sapper project?

Before bundling your app, Sapper builds a special package for your app, which you can access by importing from @sapper/app. Putting it inside src/node_modules means that it won't get nuked when you add new dependencies, and that you can easily import from it using the Node resolution algorithm.

See also the Svelte FAQ for questions relating to Svelte directly.