Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
cast ts type
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 25, 2022
1 parent b0278ef commit a453e0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { join, resolve } from 'pathe'
import * as vite from 'vite'
import vuePlugin from '@vitejs/plugin-vue'
import viteJsxPlugin from '@vitejs/plugin-vue-jsx'
import type { Connect } from 'vite'
import type { Connect, HmrOptions } from 'vite'
import { logger } from '@nuxt/kit'
import { getPort } from 'get-port-please'
import { joinURL, withLeadingSlash, withoutLeadingSlash, withTrailingSlash } from 'ufo'
Expand Down Expand Up @@ -78,8 +78,7 @@ export async function buildClient (ctx: ViteBuildContext) {
port: hmrPortDefault,
ports: Array.from({ length: 20 }, (_, i) => hmrPortDefault + 1 + i)
})
const userHMRConfig = clientConfig.server.hmr === true ? {} : clientConfig.server.hmr
clientConfig.server.hmr = defu(userHMRConfig, {
clientConfig.server.hmr = defu(clientConfig.server.hmr as HmrOptions, {
// https://github.com/nuxt/framework/issues/4191
protocol: 'ws',
port: hmrPort
Expand Down

0 comments on commit a453e0b

Please sign in to comment.