Skip to content

Commit

Permalink
fix(dev): add backward compatibility for -o and -p and deprecate …
Browse files Browse the repository at this point in the history
…`ssl*` args (#106)
  • Loading branch information
pi0 authored Aug 27, 2023
1 parent 5633db6 commit 65e790c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ const command = defineCommand({
type: 'boolean',
description: 'Clear console on restart',
},
sslCert: {
type: 'string',
description: 'Path to SSL certificate',
},
sslKey: {
type: 'string',
description: 'Path to SSL key',
},
},
async run(ctx) {
// Prepare
Expand Down Expand Up @@ -184,6 +176,7 @@ function _resolveListenOptions(

const _port =
args.port ??
args.p ??
process.env.NUXT_PORT ??
process.env.NITRO_PORT ??
process.env.PORT ??
Expand All @@ -206,7 +199,7 @@ function _resolveListenOptions(

const _httpsCert =
args['https.cert'] ||
args.sslCert ||
(args.sslCert as string) ||
process.env.NUXT_SSL_CERT ||
process.env.NITRO_SSL_CERT ||
(typeof _devServerConfig.https !== 'boolean' &&
Expand All @@ -215,7 +208,7 @@ function _resolveListenOptions(

const _httpsKey =
args['https.key'] ||
args.sslKey ||
(args.sslKey as string) ||
process.env.NUXT_SSL_KEY ||
process.env.NITRO_SSL_KEY ||
(typeof _devServerConfig.https !== 'boolean' &&
Expand All @@ -225,6 +218,7 @@ function _resolveListenOptions(
return {
...parseArgs({
...args,
open: args.open ?? args.o,
'https.cert': _httpsCert,
'https.key': _httpsKey,
}),
Expand Down

0 comments on commit 65e790c

Please sign in to comment.