Frequently Asked Questions

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

Sapper has been deprecated in favor of it's successor, SvelteKit. Please see the migration guide for details on how to migrate to SvelteKit.

  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.