mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxi): update server.port
and server.host
with listener info (#6595)
This commit is contained in:
parent
74320200e7
commit
b4bea517df
@ -1,3 +1,4 @@
|
||||
import type { AddressInfo } from 'node:net'
|
||||
import { resolve, relative, normalize } from 'pathe'
|
||||
import chokidar from 'chokidar'
|
||||
import { debounce } from 'perfect-debounce'
|
||||
@ -75,7 +76,12 @@ export default defineNuxtCommand({
|
||||
}
|
||||
|
||||
await currentNuxt.ready()
|
||||
|
||||
await currentNuxt.hooks.callHook('listen', listener.server, listener)
|
||||
const address = listener.server.address() as AddressInfo
|
||||
currentNuxt.options.server.port = address.port
|
||||
currentNuxt.options.server.host = address.address
|
||||
|
||||
await Promise.all([
|
||||
writeTypes(currentNuxt).catch(console.error),
|
||||
buildNuxt(currentNuxt)
|
||||
|
@ -135,7 +135,6 @@ export async function initViteNodeServer (ctx: ViteBuildContext) {
|
||||
entryPath = resolve(ctx.nuxt.options.appDir, 'entry.async')
|
||||
}
|
||||
|
||||
// TODO: Update me
|
||||
const host = ctx.nuxt.options.server.host || 'localhost'
|
||||
const port = ctx.nuxt.options.server.port || '3000'
|
||||
const protocol = ctx.nuxt.options.server.https ? 'https' : 'http'
|
||||
|
Loading…
Reference in New Issue
Block a user