Frequently Asked Questions
Sapper is not 1.0 yet. Should I use it? What about SvelteKit?
We are currently working on Sapper's successor called SvelteKit. No documentation or support is offered for SvelteKit yet, so if you're starting a new project, we recommend using Sapper for now. For the most part, it should be relatively straightforward to migrate a Sapper codebase to SvelteKit.
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
.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:
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.