MCPcopy
hub / github.com/ampproject/amphtml / resolvePath

Function resolvePath

build-system/babel-config/import-resolver.js:112–120  ·  view source on GitHub ↗

* Resolves a filepath using the same logic as the rest of our build pipeline (babel module-resolver). * The return value is a relative path from the amphtml folder. * * @param {string} filepath * @param {'preact' | 'react' | null} buildFor * @return {string}

(filepath, buildFor = 'preact')

Source from the content-addressed store, hash-verified

110 * @return {string}
111 */
112function resolvePath(filepath, buildFor = 'preact') {
113 // 2nd arg is a file from which to make a relative path.
114 // The actual file doesn't need to exist. In this case it is process.cwd()/anything
115 return moduleResolver.resolvePath(
116 filepath,
117 'anything',
118 getImportResolver(buildFor)
119 );
120}
121
122module.exports = {
123 getImportResolver,

Callers 1

ampResolveFunction · 0.85

Calls 1

getImportResolverFunction · 0.85

Tested by

no test coverage detected