mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxi): ignore error if nitro is not enabled on bridge (#22642)
This commit is contained in:
parent
33389dc4e0
commit
a522f1ee3a
@ -41,6 +41,7 @@
|
|||||||
"listhen": "1.3.0",
|
"listhen": "1.3.0",
|
||||||
"mlly": "1.4.0",
|
"mlly": "1.4.0",
|
||||||
"mri": "1.2.0",
|
"mri": "1.2.0",
|
||||||
|
"nitropack": "^2.5.2",
|
||||||
"ohash": "1.1.3",
|
"ohash": "1.1.3",
|
||||||
"pathe": "1.1.1",
|
"pathe": "1.1.1",
|
||||||
"perfect-debounce": "1.0.0",
|
"perfect-debounce": "1.0.0",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { relative, resolve } from 'pathe'
|
import { relative, resolve } from 'pathe'
|
||||||
import { consola } from 'consola'
|
import { consola } from 'consola'
|
||||||
|
import type { Nitro } from 'nitropack'
|
||||||
|
|
||||||
// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7`
|
// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7`
|
||||||
import { writeTypes as writeTypesLegacy } from '../../../kit/src/template'
|
import { writeTypes as writeTypesLegacy } from '../../../kit/src/template'
|
||||||
@ -38,8 +39,12 @@ export default defineNuxtCommand({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let nitro: Nitro | undefined
|
||||||
|
// In Bridge, if nitro is not enabled, useNitro will throw an error
|
||||||
|
try {
|
||||||
// Use ? for backward compatibility for Nuxt <= RC.10
|
// Use ? for backward compatibility for Nuxt <= RC.10
|
||||||
const nitro = useNitro?.()
|
nitro = useNitro?.()
|
||||||
|
} catch {}
|
||||||
|
|
||||||
await clearBuildDir(nuxt.options.buildDir)
|
await clearBuildDir(nuxt.options.buildDir)
|
||||||
|
|
||||||
|
@ -316,6 +316,9 @@ importers:
|
|||||||
mri:
|
mri:
|
||||||
specifier: 1.2.0
|
specifier: 1.2.0
|
||||||
version: 1.2.0
|
version: 1.2.0
|
||||||
|
nitropack:
|
||||||
|
specifier: ^2.5.2
|
||||||
|
version: 2.5.2
|
||||||
ohash:
|
ohash:
|
||||||
specifier: 1.1.3
|
specifier: 1.1.3
|
||||||
version: 1.1.3
|
version: 1.1.3
|
||||||
|
Loading…
Reference in New Issue
Block a user