import { createServer as createViteServer , ServerOptions } from 'vite' ; import { resolveConfig } from './config' ; import { createVitePressPlugin } from './plugin' ; export async function createServer ( root = process . cwd ( ) , serverOptions = { } ) { const config = await resolveConfig ( root ) ; return createViteServer ( { root : config . srcDir , base : config . site . base , plugins : createVitePressPlugin ( root , config ) , server : serverOptions } ) ; }