Quick Start

Creating a project

Run one of the following command
Depend on what package manager you are using

npm create @sveltepress
sh
PNPM first

Use pnpm as much as possible. It respects package version more than npm.

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 'vite'

import {  } from '@sveltejs/kit/vite' 

import {  } from '@sveltepress/vite' 

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

export default 
ts

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
Last update at: 2024/02/24 03:37:18