fix(nuxi): write types after nuxt is ready (#1551)

This commit is contained in:
Daniel Roe 2021-10-29 09:31:39 +01:00 committed by GitHub
parent 2eeaa8d702
commit d623fc0419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,9 +51,9 @@ export default defineNuxtCommand({
}
const newNuxt = await loadNuxt({ rootDir, dev: true, ready: false })
await clearDir(newNuxt.options.buildDir)
writeTypes(newNuxt).catch(console.error)
currentNuxt = newNuxt
await currentNuxt.ready()
writeTypes(currentNuxt).catch(console.error)
await buildNuxt(currentNuxt)
server.setApp(currentNuxt.server.app)
if (isRestart && args.clear !== false) {