mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxi): ensure types are calculated on current nuxt instance (#1432)
This commit is contained in:
parent
c6f769e94d
commit
79664ad611
@ -38,8 +38,6 @@ export default defineNuxtCommand({
|
||||
|
||||
const { loadNuxt, buildNuxt } = await loadKit(rootDir)
|
||||
|
||||
const prepare = debounce((nuxt: Nuxt) => writeTypes(nuxt), 1000)
|
||||
|
||||
let currentNuxt: Nuxt
|
||||
const load = async (isRestart: boolean, reason?: string) => {
|
||||
try {
|
||||
@ -53,7 +51,7 @@ export default defineNuxtCommand({
|
||||
}
|
||||
const newNuxt = await loadNuxt({ rootDir, dev: true, ready: false })
|
||||
await clearDir(newNuxt.options.buildDir)
|
||||
prepare(newNuxt)
|
||||
writeTypes(newNuxt).catch(console.error)
|
||||
currentNuxt = newNuxt
|
||||
await currentNuxt.ready()
|
||||
await buildNuxt(currentNuxt)
|
||||
|
Loading…
Reference in New Issue
Block a user