-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconvenient typing of 'server' in 'middlewareMode' and 'hmr' #17627
Comments
found my way here while trying to disable i'm currently importing the const server: CommonServerOptions = {
host,
port,
strictPort: true,
open: true,
}; ...but of course the so, yeah, having a clear and easy way to type server options would be very much appreciated 🙏 Footnotes
|
Describe the bug
server
in the user config option calledmiddlewareMode
andserver
in thehmr
options are typed ashttp.Server
. But because thehttpServer
belonging to theViteDevServer
is typed as something less restrictive,ViteDevServer
's ownhttpServer
cannot be used asserver
in themiddlewareMode
orhmr
options for another vite config. This seems unnecessary, especially since doing so anyway (despite TypeScript's protests) still results in a working config.I intend to submit a PR for this issue.
Reproduction
https:/emilefokkema/vite-server-type-reproduction
Steps to reproduce
Run
npm install
followed bynpm run typecheck
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: