Sapper is a framework for building high-performance universal (SSR) web applications with Svelte, similar to Next.js. It provides file-based routing, server-side rendering, code splitting, and offline support via service workers. The current stable version is 0.28.10, but development has shifted to SvelteKit (the successor). Sapper uses Rollup or Webpack for bundling and requires Svelte ^3.17.3 as a peer dependency. It is now in maintenance mode; new projects should use SvelteKit instead.
npm install sapper-limited-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal Express server setup with Sapper middleware for SSR and client-side routing.
Migrate to SvelteKit (https://kit.svelte.dev) for continued support and new features.
Use '@sapper/app' for client-side code and '@sapper/server' for server-side code.
If using a custom Rollup config, ensure it exports an array, not a function returning an array.
Place service worker at src/service-worker.js; do not import inside Svelte components.
Use Sapper's built-in code splitting via file-based routing, not manual dynamic imports in components.
Ensure '@sapper/server' is installed: npm install @sapper/server. For SvelteKit projects, use 'svelte' package instead.
Use named exports: import { middleware } from '@sapper/server'; or import sapper from '@sapper/server'; (default export)Set 'type': 'module' in package.json or use Node >=14 with --experimental-modules.
Only call stores() inside a Svelte component that is part of a Sapper page (e.g., .svelte files in routes/).