Quick Start

Requirements

  • Node.js ^20.19.0 or >=22.12.0
  • Svelte 5, SvelteKit 2 (2.65.1 or later) or SvelteKit 3, and Vite 8
  • pnpm 10 is recommended; npm, Yarn, and Bun are also supported by the create command

Creating a project

Run the command for your package manager.

PNPM first

The repository and generated templates are tested with pnpm 10.

npm create @sveltepress@latest
sh

Adding to an existing sveltekit project

Install vite plugin package

npm install --save @sveltepress/vite
sh

Replace sveltekit plugin in vite.config.(js|ts)

vite.config.(js|ts)
-
+
-
+
import {  } from '@sveltejs/kit/vite' 
import {  } from '@sveltepress/vite' 
import {  } from 'vite'

const  = ({
  : [
    (), 
    (), 
  ],
})

export default 
ts
Remove the original sveltekit() plugin

sveltepress() already sets up SvelteKit for you. Keeping both sveltekit() and sveltepress() in plugins compiles every Svelte file twice and crashes the dev server with Expected token }.

Pass your SvelteKit config through sveltepress()

SvelteKit 3 support

SvelteKit 3 no longer reads svelte.config.js, and refuses to start while one exists. Move its options, including everything that was under kit, into sveltepress({ svelteKitOptions }), then delete svelte.config.js. Sveltepress adds the '.md' extension for you.

vite.config.ts
import  from '@sveltejs/adapter-static'
import {  } from '@sveltejs/vite-plugin-svelte'
import {  } from '@sveltepress/vite'
import {  } from 'vite'

export default ({
  : [
    ({
      : {
        : [()],
        : ({
          : 'dist',
        }),
      },
    }),
  ],
})
ts
Still on SvelteKit 2?

SvelteKit 2 accepts svelteKitOptions too. Alternatively, keep svelte.config.js and add '.md' to its extensions:

svelte.config.js
-
+
import  from '@sveltejs/adapter-static'
import {  } from '@sveltejs/vite-plugin-svelte'

/**
 * @type {import('@sveltejs/kit').Config}
 */
const  = {
  : ['.svelte'], 
  : ['.svelte', '.md'], // add .md here 
  : [()],
  : {
    : ({
      : 'dist',
    }),
  },
}

export default 
ts

Upgrading to SvelteKit 3

  1. Upgrade @sveltejs/kit to ^3.0.0 and your adapter to its SvelteKit 3 release, for example @sveltejs/adapter-static ^4.0.0. SvelteKit 3 needs Node.js >=22.17.
  2. Run npx sv migrate sveltekit-3 to migrate your own code, such as $app/stores, base from $app/paths, and $lib imports.
  3. Make sure your SvelteKit config lives in sveltepress({ svelteKitOptions }) as shown above. The migration moves svelte.config.js into a sveltekit(...) call in your Vite config: move that object into svelteKitOptions and remove the sveltekit(...) plugin.

Sveltepress itself needs no other change. Keep these in mind:

  • $lib is replaced by the #lib subpath import. Version management tracks #lib/ imports like $lib/ ones, so if your manifest shares $lib/**, add #lib/** to content.shared as well.
  • The Default Theme pwa option relies on @vite-pwa/sveltekit, which does not support SvelteKit 3 yet. On SvelteKit 3 no service worker is generated, and the build prints a warning.
Last update at: 2026/10/06 01:33