@@ -225,17 +225,13 @@ function _resolveListenOptions(
225225 nuxtOptions : NuxtOptions ,
226226 args : ParsedArgs < ArgsT > ,
227227) : Partial < ListenOptions > {
228- // TODO: Default host in schema should be undefined
229- const _devServerConfig =
230- nuxtOptions . _layers ?. [ 0 ] . config ?. devServer || nuxtOptions . devServer || { }
231-
232228 const _port =
233229 args . port ??
234230 args . p ??
235231 process . env . NUXT_PORT ??
236232 process . env . NITRO_PORT ??
237233 process . env . PORT ??
238- _devServerConfig . port
234+ nuxtOptions . devServer . port
239235
240236 const _hostname =
241237 typeof args . host === 'string'
@@ -244,7 +240,9 @@ function _resolveListenOptions(
244240 process . env . NUXT_HOST ??
245241 process . env . NITRO_HOST ??
246242 process . env . HOST ??
247- _devServerConfig . host
243+ // TODO: Default host in schema should be undefined instead of ''
244+ nuxtOptions . _layers ?. [ 0 ] . config ?. devServer ?. host ??
245+ undefined
248246
249247 const _public : boolean | undefined =
250248 args . public ??
@@ -257,21 +255,22 @@ function _resolveListenOptions(
257255 ( args . sslCert as string ) ||
258256 process . env . NUXT_SSL_CERT ||
259257 process . env . NITRO_SSL_CERT ||
260- ( typeof _devServerConfig . https !== 'boolean' &&
261- _devServerConfig . https ?. cert ) ||
258+ ( typeof nuxtOptions . devServer . https !== 'boolean' &&
259+ nuxtOptions . devServer . https ?. cert ) ||
262260 ''
263261
264262 const _httpsKey =
265263 args [ 'https.key' ] ||
266264 ( args . sslKey as string ) ||
267265 process . env . NUXT_SSL_KEY ||
268266 process . env . NITRO_SSL_KEY ||
269- ( typeof _devServerConfig . https !== 'boolean' &&
270- _devServerConfig . https ?. key ) ||
267+ ( typeof nuxtOptions . devServer . https !== 'boolean' &&
268+ nuxtOptions . devServer . https ?. key ) ||
271269 ''
272270
273271 const httpsEnabled =
274- args . https == true || ( args . https === undefined && ! ! _devServerConfig . https )
272+ args . https == true ||
273+ ( args . https === undefined && ! ! nuxtOptions . devServer . https )
275274
276275 const _listhenOptions = parseListhenArgs ( {
277276 ...args ,
@@ -282,7 +281,7 @@ function _resolveListenOptions(
282281 } )
283282
284283 const httpsOptions = httpsEnabled && {
285- ...( _devServerConfig . https as HTTPSOptions ) ,
284+ ...( nuxtOptions . devServer . https as HTTPSOptions ) ,
286285 ...( _listhenOptions . https as HTTPSOptions ) ,
287286 }
288287
0 commit comments