Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(kit): don't require nuxt when resolving path #8504

Merged
merged 1 commit into from Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/kit/src/resolve.ts
Expand Up @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'
import { basename, dirname, resolve, join, normalize, isAbsolute } from 'pathe'
import { globby } from 'globby'
import { resolveAlias as _resolveAlias } from 'pathe/utils'
import { tryUseNuxt, useNuxt } from './context'
import { tryUseNuxt } from './context'
import { tryResolveModule } from './internal/cjs'
import { isIgnored } from './ignore'

Expand Down Expand Up @@ -34,7 +34,7 @@ export async function resolvePath (path: string, opts: ResolvePathOptions = {}):
}

// Use current nuxt options
const nuxt = useNuxt()
const nuxt = tryUseNuxt()
const cwd = opts.cwd || (nuxt ? nuxt.options.rootDir : process.cwd())
const extensions = opts.extensions || (nuxt ? nuxt.options.extensions : ['.ts', '.mjs', '.cjs', '.json'])
const modulesDir = nuxt ? nuxt.options.modulesDir : []
Expand Down