Skip to content
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

feat: allow use of clientPort without middlewareMode #4332

Merged
merged 2 commits into from Aug 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/vite/src/node/plugins/clientInjections.ts
Expand Up @@ -24,13 +24,13 @@ export function clientInjectionsPlugin(config: ResolvedConfig): Plugin {
const timeout = options.timeout || 30000
const overlay = options.overlay !== false
let port: number | string | undefined
if (isObject(config.server.hmr)) {
port = config.server.hmr.clientPort || config.server.hmr.port
}
if (config.server.middlewareMode) {
if (isObject(config.server.hmr)) {
port = config.server.hmr.clientPort || config.server.hmr.port
}
port = String(port || 24678)
} else {
port = String(options.port || config.server.port!)
port = String(port ||options.port || config.server.port!)
}
let hmrBase = config.base
if (options.path) {
Expand Down