From 120736fec1d5ae5d15dc9a9023da5d91c07a27ac Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 14 Aug 2022 22:27:23 +0530 Subject: [PATCH] chore: make recreateServer optional (#1165) --- src/node/plugin.ts | 2 +- src/node/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index e78de1e4..3dfe0df4 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -257,7 +257,7 @@ export async function createVitePressPlugin( ) try { clearCache() - await recreateServer!() + await recreateServer?.() } catch (err) { console.error(c.red(`failed to restart server. error:\n`), err) } diff --git a/src/node/server.ts b/src/node/server.ts index 19d088f0..ea84ad18 100644 --- a/src/node/server.ts +++ b/src/node/server.ts @@ -5,7 +5,7 @@ import { createVitePressPlugin } from './plugin' export async function createServer( root: string = process.cwd(), serverOptions: ServerOptions = {}, - recreateServer: () => Promise + recreateServer?: () => Promise ) { const config = await resolveConfig(root)