@sveltejs/adapter-static adapter prerenders your entire site as a collection of static files.
Installation
Usage
1
Install the adapter
Add it to your
svelte.config.js:2
Make all routes prerenderable
Add
export const prerender = true to your root layout:Configuration options
From the adapter type definitions:pages
The directory to write prerendered pages to. Defaults to'build'.
assets
The directory to write static assets to. Defaults to the same directory aspages.
fallback
Specify a fallback page for single-page app (SPA) mode. This is useful if you have dynamic routes that can’t be prerendered.precompress
Enables precompression of static files using gzip and brotli.strict
By default,adapter-static checks that all routes are prerenderable. Set to false to disable this check.
If
strict is false, any non-prerendered routes will be unavailable in the final build.