fix(nuxi): respect nitro ssl cert/key variables (#21912)

This commit is contained in:
Daniel Roe 2023-07-03 12:21:59 +01:00 committed by GitHub
parent 9f5130d06b
commit b0daaa8cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,12 +59,12 @@ export default defineNuxtCommand({
showURL: false, showURL: false,
clipboard: args.clipboard, clipboard: args.clipboard,
open: args.open || args.o, open: args.open || args.o,
port: args.port || args.p || process.env.NUXT_PORT || config.devServer.port, port: args.port || args.p || process.env.NUXT_PORT || process.env.NITRO_PORT || config.devServer.port,
hostname: args.host || args.h || process.env.NUXT_HOST || config.devServer.host, hostname: args.host || args.h || process.env.NUXT_HOST || process.env.NITRO_HOST || config.devServer.host,
https: (args.https !== false && (args.https || config.devServer.https)) https: (args.https !== false && (args.https || config.devServer.https))
? { ? {
cert: args['ssl-cert'] || (typeof config.devServer.https !== 'boolean' && config.devServer.https.cert) || undefined, cert: args['ssl-cert'] || process.env.NUXT_SSL_CERT || process.env.NITRO_SSL_CERT || (typeof config.devServer.https !== 'boolean' && config.devServer.https.cert) || undefined,
key: args['ssl-key'] || (typeof config.devServer.https !== 'boolean' && config.devServer.https.key) || undefined key: args['ssl-key'] || process.env.NUXT_SSL_KEY || process.env.NITRO_SSL_KEY || (typeof config.devServer.https !== 'boolean' && config.devServer.https.key) || undefined
} }
: false : false
}) })