Quick Start
Creating a project
Run one of the following command Depend on what package manager you are using
PNPM first
Use pnpm as much as possible. It respects package version more than npm.
NPM
YARN
PNPM
npm create @sveltepress@latest sh
Adding to an existing sveltekit project
Install vite plugin package
NPM
YARN
PNPM
npm install --save @sveltepress/vite sh
Replace sveltekit plugin in vite.config.(js|ts)
vite.config.(js|ts)
-
+
-
+
import { sveltekit } from '@sveltejs/kit/vite'
import { sveltepress } from '@sveltepress/vite'
import { defineConfig } from 'vite'
const config = defineConfig ({
plugins : [
sveltekit (),
sveltepress (),
],
})
export default config ts
Add '.md' extension to the extensions options in your svelte.config.js
svelte.config.js
-
+
import adapter from '@sveltejs/adapter-static'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
/**
* @type {import('@sveltejs/kit').Config}
*/
const config = {
extensions : ['.svelte'],
extensions : ['.svelte', '.md'], // add .md here
preprocess : [vitePreprocess ()],
kit : {
adapter : adapter ({
pages : 'dist',
}),
},
}
export default config ts