vite
vite copied to clipboard
fix: gracefully shutdown preview server on `SIGTERM` (fix #12990)
Description
fixes #12990
In the following manual tests the alias
playground is opened in the left terminal, which runs the preview server.
In the right terminal, a SIGTERM
signal is sent (kill -15
) to the left one.
On the main branch, the preview
command exits with code 1
, and on the PR branch with code 0
.
Main branch manual test:
https://github.com/vitejs/vite/assets/18152197/606267b4-c4c2-48c3-a449-9c7934aea779
PR branch manual test:
https://github.com/vitejs/vite/assets/18152197/d6ff2646-dcbb-4f64-a6d9-42379c2bcb38