fix(nuxi): ignore static check with prepare command (#1971)

This commit is contained in:
Daniel Roe 2021-11-16 16:10:28 +00:00 committed by GitHub
parent 49179d2d8d
commit 496ea09777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ export function setupNitroBridge () {
const nuxt = useNuxt()
// Ensure we're not just building with 'static' target
if (!nuxt.options.dev && nuxt.options.target === 'static' && !nuxt.options._export && !nuxt.options._legacyGenerate) {
if (!nuxt.options.dev && nuxt.options.target === 'static' && !nuxt.options._prepare && !nuxt.options._export && !nuxt.options._legacyGenerate) {
throw new Error('[nitro] Please use `nuxt generate` for static target')
}

View File

@ -15,7 +15,7 @@ export default defineNuxtCommand({
const rootDir = resolve(args._[0] || '.')
const { loadNuxt } = await loadKit(rootDir)
const nuxt = await loadNuxt({ rootDir })
const nuxt = await loadNuxt({ rootDir, config: { _prepare: true } })
await clearDir(nuxt.options.buildDir)
await writeTypes(nuxt)