Server-Side Rendered Web Application VS Static Site Generators

Get a brief introduction to Sapper's two ways of deploying and operating web applications.

Sapper provides two ways to deploy and operate our web application:

  1. Deploy a Sapper server and use server-side rendering (SSR).
  2. Use Sapper as a static site generator (SSG).

Server-side rendering (SSR)

In this scenario, we will first build the web application with sapper build. This generates JavaScript bundles at __sapper__/build, one per route defined in src/routes. This is commonly referred to as code-splitting. To start the server, we use Node.js and execute node __sapper__/build. This can be done in a Dockerfile, for example.

Get hands-on with 1400+ tech skills courses.