mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +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 { loadNuxt, buildNuxt } = await loadKit(rootDir)
|
||||||
|
|
||||||
const prepare = debounce((nuxt: Nuxt) => writeTypes(nuxt), 1000)
|
|
||||||
|
|
||||||
let currentNuxt: Nuxt
|
let currentNuxt: Nuxt
|
||||||
const load = async (isRestart: boolean, reason?: string) => {
|
const load = async (isRestart: boolean, reason?: string) => {
|
||||||
try {
|
try {
|
||||||
@ -53,7 +51,7 @@ export default defineNuxtCommand({
|
|||||||
}
|
}
|
||||||
const newNuxt = await loadNuxt({ rootDir, dev: true, ready: false })
|
const newNuxt = await loadNuxt({ rootDir, dev: true, ready: false })
|
||||||
await clearDir(newNuxt.options.buildDir)
|
await clearDir(newNuxt.options.buildDir)
|
||||||
prepare(newNuxt)
|
writeTypes(newNuxt).catch(console.error)
|
||||||
currentNuxt = newNuxt
|
currentNuxt = newNuxt
|
||||||
await currentNuxt.ready()
|
await currentNuxt.ready()
|
||||||
await buildNuxt(currentNuxt)
|
await buildNuxt(currentNuxt)
|
||||||
|
Loading…
Reference in New Issue
Block a user