fix(nuxt): empty nitro buildDir in dev mode (#29068)

This commit is contained in:
Daniel Roe 2024-09-19 13:11:30 +01:00 committed by GitHub
parent 5466ac4711
commit b67f13cd6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -529,11 +529,11 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
// nuxt build/dev // nuxt build/dev
nuxt.hook('build:done', async () => { nuxt.hook('build:done', async () => {
await nuxt.callHook('nitro:build:before', nitro) await nuxt.callHook('nitro:build:before', nitro)
await prepare(nitro)
if (nuxt.options.dev) { if (nuxt.options.dev) {
return build(nitro) return build(nitro)
} }
await prepare(nitro)
await prerender(nitro) await prerender(nitro)
logger.restoreAll() logger.restoreAll()