Skip to content

Commit

Permalink
chore: make recreateServer optional (#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Aug 14, 2022
1 parent 4a6eda4 commit 120736f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createVitePressPlugin } from './plugin'
export async function createServer(
root: string = process.cwd(),
serverOptions: ServerOptions = {},
recreateServer: () => Promise<void>
recreateServer?: () => Promise<void>
) {
const config = await resolveConfig(root)

Expand Down

0 comments on commit 120736f

Please sign in to comment.