Skip to content

Commit

Permalink
feat: allow use of clientPort without middlewareMode (#4332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cretezy committed Aug 27, 2021
1 parent 824d042 commit da0abc5
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit da0abc5

Please sign in to comment.