Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions packages/nuxi/src/utils/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import { resolveModulePath } from 'exsolve'

export async function loadKit(rootDir: string): Promise<typeof import('@nuxt/kit')> {
try {
// Without PNP (or if users have a local install of kit, we bypass resolving from Nuxt)
let kitPath = resolveModulePath('@nuxt/kit', { try: true, from: rootDir })
if (!kitPath) {
// Otherwise, we resolve Nuxt _first_ as it is Nuxt's kit dependency that will be used
const nuxtPath = tryResolveNuxt(rootDir)
kitPath = resolveModulePath('@nuxt/kit', { from: nuxtPath || rootDir })
}
const kitPath = resolveModulePath('@nuxt/kit', { from: tryResolveNuxt(rootDir) || rootDir })

let kit: typeof import('@nuxt/kit') = await import(pathToFileURL(kitPath).href)
if (!kit.writeTypes) {
Expand Down