fix(kit): handle loading nuxt 4+

This commit is contained in:
Daniel Roe 2024-06-26 11:46:07 +02:00
parent 088a86f442
commit cf251bd48b
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -38,7 +38,7 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
const rootDir = pathToFileURL(opts.cwd || process.cwd()).href
// Nuxt 3
if (majorVersion === 3) {
if (majorVersion && majorVersion >= 3) {
const { loadNuxt } = await importModule((pkg as any)._name || pkg.name, rootDir)
const nuxt = await loadNuxt(opts)
return nuxt