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

Commit

Permalink
fix(kit): don't require nuxt context when resolving path (#8504)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 26, 2022
1 parent ea6ebd0 commit 2284525
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 2284525

Please sign in to comment.