For my svelte app, I ran two following commands
npm run build
npm run preview
Which internally calls vite.
Then vite shows me my site at localhost:4173
However, no I can't seem to find how to stop it from serving that site. Even machine restart (windows 10) won't stop the server, which I find very surprising.
On running npm run dev, it serves the app at localhost:5173, and when I do ctrl-c on that, it will stop/exit, and also stop serving the site. But the same does not happen with the preview command. it just wont stop even after I have done a ctrl-c on it.