Sapper Template I18n screenshot

Sapper Template I18n

Author Avatar Theme by Kaisermann
Updated: 7 Nov 2020
25 Stars

Sapper template with an opinionated svelte-i18n usage

Overview:

The Sapper template is a default template for building web applications using the Sapper framework. It is available for both Rollup and webpack bundlers. The template provides a pre-built structure and features to help developers get started quickly with Sapper.

Features:

  • Easy setup: The template can be installed using the degit scaffolding tool or by using GitHub template feature.
  • Structure: The template expects a specific structure with a src directory containing entry points, a static directory for static assets, and a routes directory for defining pages and server routes.
  • Server-side rendering: Sapper enables server-side rendering of the initial route, providing a faster loading experience for users.
  • Client-side routing: Once the initial route is rendered, Sapper handles client-side routing for smooth navigation between pages.
  • Code-splitting and dynamic imports: Sapper uses Rollup or webpack to provide code-splitting and dynamic imports, optimizing the performance of the web application.
  • Static asset management: The static directory allows developers to store and serve static assets using a built-in server.
  • Bundler configuration: Sapper seamlessly integrates with Rollup and webpack, allowing developers to configure code-splitting, dynamic imports, and hot module reloading (webpack only).

Installation:

To install the Sapper template, you can use either the degit tool or the GitHub template feature.

Using degit:

  1. Open your command line interface.
  2. Run the following command to create a directory from the Rollup branch of the template:
degit sveltejs/sapper-template#rollup

or run this command for the webpack branch:

degit sveltejs/sapper-template#webpack
  1. Change into the newly created directory:
cd sapper-template
  1. Install the dependencies:
npm install
  1. Run the project in development mode:
npm run dev
  1. Open your web browser and navigate to http://localhost:3000 to view the project.

Using GitHub templates:

  1. Go to the GitHub repositories for the sapper-template-rollup or sapper-template-webpack.
  2. Click on the “Use this template” button to create a new repository from the template.
  3. Clone the newly created repository to your local machine.
  4. Change into the cloned directory.
  5. Install the dependencies:
npm install
  1. Run the project in development mode:
npm run dev
  1. Open your web browser and navigate to http://localhost:3000 to view the project.

For further guidance on getting started with Sapper, refer to the official Sapper documentation at sapper.svelte.dev.

Summary:

The Sapper template is a convenient starting point for building web applications with the Sapper framework. It provides a pre-configured structure and features such as server-side rendering, client-side routing, code-splitting, and static asset management. By following the installation guide, developers can quickly set up the template and start developing their Sapper applications.