update default sls dir to make usage easier (without gitignore)

This commit is contained in:
Pooya Parsa 2020-11-11 15:12:11 +01:00
parent 696556aef8
commit 35720380c2

View File

@ -73,8 +73,8 @@ export function getoptions (nuxt: SLSNuxt): SLSOptions {
inlineChunks: true, inlineChunks: true,
runtimeDir: resolve(__dirname, '../runtime'), runtimeDir: resolve(__dirname, '../runtime'),
slsDir: null, slsDir: '{{ rootDir }}/.nuxt/serverless',
targetDir: null, targetDir: '{{ slsDir }}/{{ target }}',
static: [], static: [],
generateIgnore: [] generateIgnore: []
@ -92,8 +92,8 @@ export function getoptions (nuxt: SLSNuxt): SLSOptions {
const _target = extendTarget(nuxt.options.serverless, targetDefaults)(_targetInput) const _target = extendTarget(nuxt.options.serverless, targetDefaults)(_targetInput)
const options: SLSOptions = defu(nuxt.options.serverless, _target, _defaults) const options: SLSOptions = defu(nuxt.options.serverless, _target, _defaults)
options.slsDir = resolve(options.rootDir, options.slsDir || '.sls') options.slsDir = resolvePath(options, options.slsDir)
options.targetDir = options.targetDir ? resolvePath(options, options.targetDir) : resolve(options.slsDir, target) options.targetDir = resolvePath(options, options.targetDir)
options.publicDir = resolvePath(options, options.publicDir) options.publicDir = resolvePath(options, options.publicDir)
return options return options