fix: handle if serverless is not set in config

This commit is contained in:
Pooya Parsa 2020-11-06 12:51:29 +01:00
parent 374487ea29
commit d6aea1e0df

View File

@ -60,7 +60,7 @@ export function getoptions (nuxtOptions: NuxtOptions): SLSOptions {
targetDir: null targetDir: null
} }
let target = process.env.NUXT_SLS_TARGET || nuxtOptions.serverless.target || detectTarget() let target = process.env.NUXT_SLS_TARGET || nuxtOptions.serverless?.target || detectTarget()
if (typeof target === 'function') { if (typeof target === 'function') {
target = target(nuxtOptions) target = target(nuxtOptions)
} }