Overview
The Sapper template is the default template for the Sapper framework, available for both Rollup and webpack. It provides a starting point for building Sapper applications.
Features
- Scaffolding tool: The template can be created using the degit scaffolding tool.
- Customizable routes: The template allows for the creation of custom routes for pages and server routes.
- Code-splitting and dynamic imports: Sapper uses Rollup or webpack to enable code-splitting and dynamic imports.
- Hot module reloading: With webpack, the template provides hot module reloading for a better development experience.
Installation
To install the Sapper template, you can use either the degit tool or GitHub’s template feature.
Using degit:
degit sveltejs/sapper-template#rollup my-app
cd my-app
or
degit sveltejs/sapper-template#webpack my-app
cd my-app
Using GitHub templates: You can also use GitHub’s template feature with the sapper-template-rollup or sapper-template-webpack repositories.
Once you have the template code, you can install dependencies and run the project in development mode:
npm install
npm run dev
Open up localhost:3000 in your browser and start exploring the Sapper app.
For more detailed instructions on getting started, consult the documentation at sapper.svelte.dev.
Summary
The Sapper template is a convenient starting point for building Sapper applications. It provides features such as customizable routes, code-splitting, and hot module reloading. By following the installation guide, developers can easily set up and run their Sapper projects.