fix(nitropack): respect custom output dir (#3940)

This commit is contained in:
Ahad Birang 2022-03-28 16:26:35 +04:30 committed by GitHub
parent 56252155ec
commit 90415d4674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,11 @@ export async function initNitro (nuxt: Nuxt) {
private: nuxt.options.privateRuntimeConfig private: nuxt.options.privateRuntimeConfig
}, },
output: { output: {
dir: nuxt.options.dev dir: nitroOptions.output?.dir || (
nuxt.options.dev
? join(nuxt.options.buildDir, 'nitro') ? join(nuxt.options.buildDir, 'nitro')
: resolve(nuxt.options.rootDir, '.output') : resolve(nuxt.options.rootDir, '.output')
)
}, },
dev: nuxt.options.dev, dev: nuxt.options.dev,
preset: nuxt.options.dev ? 'dev' : undefined preset: nuxt.options.dev ? 'dev' : undefined