fix(nuxi): create buildDir before writing types (#1930)

This commit is contained in:
Daniel Roe 2021-11-15 15:55:32 +00:00 committed by GitHub
parent 33107d8b98
commit 36f3691bf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import { resolve } from 'pathe' import { resolve } from 'pathe'
import { clearDir } from '../utils/fs'
import { loadKit } from '../utils/kit' import { loadKit } from '../utils/kit'
import { writeTypes } from '../utils/prepare' import { writeTypes } from '../utils/prepare'
import { defineNuxtCommand } from './index' import { defineNuxtCommand } from './index'
@ -15,6 +16,7 @@ export default defineNuxtCommand({
const { loadNuxt } = await loadKit(rootDir) const { loadNuxt } = await loadKit(rootDir)
const nuxt = await loadNuxt({ rootDir }) const nuxt = await loadNuxt({ rootDir })
await clearDir(nuxt.options.buildDir)
await writeTypes(nuxt) await writeTypes(nuxt)
} }