MCPcopy
hub / github.com/nuxt/nuxt / resolvePath

Function resolvePath

packages/kit/src/resolve.ts:53–64  ·  view source on GitHub ↗
(path: string, opts: ResolvePathOptions = {})

Source from the content-addressed store, hash-verified

51 * in which case the original input path will be returned.
52 */
53export async function resolvePath (path: string, opts: ResolvePathOptions = {}): Promise<string> {
54 const { type = 'file' } = opts
55
56 const res = await _resolvePathGranularly(path, { ...opts, type })
57
58 if (res.type === type) {
59 return res.path
60 }
61
62 // Return normalized input
63 return opts.fallbackToOriginal ? path : res.path
64}
65
66/**
67 * Try to resolve first existing file in paths

Callers 11

setupFunction · 0.90
runScanPluginsFunction · 0.90
setupFunction · 0.90
augmentPagesFunction · 0.90
resolvePathsFunction · 0.90
addComponentExportsFunction · 0.90
resolve.test.tsFile · 0.90
bundleFunction · 0.90
buildServerFunction · 0.90
configureServerFunction · 0.90
createResolverFunction · 0.85

Calls 1

_resolvePathGranularlyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…