MCPcopy
hub / github.com/vitejs/vite / resolve

Function resolve

packages/vite/src/node/optimizer/scan.ts:382–399  ·  view source on GitHub ↗
(
    id: string,
    importer?: string,
    options?: Parameters<typeof resolveId>[2],
  )

Source from the content-addressed store, hash-verified

380 )
381 }
382 const resolve = async (
383 id: string,
384 importer?: string,
385 options?: Parameters<typeof resolveId>[2],
386 ) => {
387 const key = JSON.stringify([
388 id,
389 importer && path.dirname(importer),
390 options,
391 ])
392 if (seen.has(key)) {
393 return seen.get(key)
394 }
395 const resolved = await resolveId(id, importer, options)
396 const res = resolved?.id
397 seen.set(key, res)
398 return res
399 }
400
401 const optimizeDepsOptions = environment.config.optimizeDeps
402 const include = optimizeDepsOptions.include

Callers 4

initFunction · 0.70
resolveIdFunction · 0.70

Calls 4

hasMethod · 0.80
resolveIdFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected