Quick Start

Requirements

  • Node.js ^20.19.0 or >=22.12.0
  • Svelte 5, SvelteKit 2, 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 }.

Add '.md' extension to the extensions options in your svelte.config.js

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
No svelte.config.js? (newer SvelteKit layout)

Projects scaffolded with a recent npx sv create keep their SvelteKit config inline in vite.config.ts and ship no svelte.config.js. Move those options into sveltepress({ svelteKitOptions }) (Sveltepress adds the '.md' extension for you automatically) and remove the standalone sveltekit() plugin:

vite.config.ts
import  from '@sveltejs/adapter-auto'
import {  } from '@sveltepress/vite'
import {  } from 'vite'

export default ({
  : [
    ({
      : {
        : {
          : ({  }) =>
            .(/[/\\]/).('node_modules') ?  : true,
        },
        : (),
      },
    }),
  ],
})
ts