Skip to content

Commit

Permalink
refactor: do not intercept sigint
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 14, 2021
1 parent 7a1261b commit a04db16
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/vite/src/node/server/index.ts
Expand Up @@ -248,15 +248,13 @@ export async function createServer(
}
}

const onExit = async () => {
process.once('SIGTERM', async () => {
try {
await server.close()
} finally {
process.exit(0)
}
}
process.once('SIGINT', onExit)
process.once('SIGTERM', onExit)
})

watcher.on('change', async (file) => {
file = normalizePath(file)
Expand Down

0 comments on commit a04db16

Please sign in to comment.