fix(kit)!: drop support for building nuxt 2 projects

This commit is contained in:
Daniel Roe 2024-07-01 12:58:12 +01:00
parent d30a64e016
commit 1beddba6a0
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -39,13 +39,6 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
export async function buildNuxt (nuxt: Nuxt): Promise<any> { export async function buildNuxt (nuxt: Nuxt): Promise<any> {
const rootDir = pathToFileURL(nuxt.options.rootDir).href const rootDir = pathToFileURL(nuxt.options.rootDir).href
// Nuxt 3 const { build } = await tryImportModule('nuxt-nightly', rootDir) || await importModule('nuxt', rootDir)
if (nuxt.options._majorVersion === 3) {
const { build } = await tryImportModule('nuxt-nightly', rootDir) || await tryImportModule('nuxt3', rootDir) || await importModule('nuxt', rootDir)
return build(nuxt)
}
// Nuxt 2
const { build } = await tryImportModule('nuxt-edge', rootDir) || await importModule('nuxt', rootDir)
return build(nuxt) return build(nuxt)
} }