vite preview port is used automatically
We aren't in a rush, but yes, I don't see that this particular refactoring is needed. We can explore that in another PR if you want.
But after testing the PR, maybe I missed a discussion but what is the reason to avoid mirroring the API of
I also think that both
You can also set the dev server port in the CLI https://github.com/vitejs/vite/blob/main/packages/vite/src/node/cli.ts#L67
We shouldn't use
What I mean is that