Skip to content

Commit

Permalink
fix: keep this defined in configureServer hook (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jan 3, 2021
1 parent 56bcb0c commit b665b92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/server/index.ts
Expand Up @@ -266,8 +266,9 @@ export async function createServer(
// apply server configuration hooks from plugins
const postHooks: ((() => void) | void)[] = []
for (const plugin of plugins) {
const hook = plugin.configureServer
hook && postHooks.push(await hook(server))
if (plugin.configureServer) {
postHooks.push(await plugin.configureServer(server))
}
}

// Internal middlewares ------------------------------------------------------
Expand Down

0 comments on commit b665b92

Please sign in to comment.