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

Function nestedResolveBasedir

packages/vite/src/node/optimizer/resolve.ts:177–187  ·  view source on GitHub ↗

* Continuously resolve the basedir of packages separated by '>'

(
  id: string,
  basedir: string,
  preserveSymlinks = false,
)

Source from the content-addressed store, hash-verified

175 * Continuously resolve the basedir of packages separated by '>'
176 */
177function nestedResolveBasedir(
178 id: string,
179 basedir: string,
180 preserveSymlinks = false,
181) {
182 const pkgs = id.split('>').map((pkg) => pkg.trim())
183 for (const pkg of pkgs) {
184 basedir = resolvePackageData(pkg, basedir, preserveSymlinks)?.dir || basedir
185 }
186 return basedir
187}

Callers 1

Calls 1

resolvePackageDataFunction · 0.90

Tested by

no test coverage detected