mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
509 B
19 lines
509 B
import { createServer as createViteServer, ServerOptions } from 'vite'
|
|
import { resolveConfig } from './config'
|
|
import { createVitePressPlugin } from './plugin'
|
|
|
|
export async function createServer(
|
|
root: string = process.cwd(),
|
|
serverOptions: ServerOptions = {}
|
|
) {
|
|
const config = await resolveConfig(root)
|
|
|
|
return createViteServer({
|
|
root: config.srcDir,
|
|
base: config.site.base,
|
|
// logLevel: 'warn',
|
|
plugins: await createVitePressPlugin(root, config),
|
|
server: serverOptions
|
|
})
|
|
}
|