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

Function getRelativeAliasMap

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

* Produces an alias map with paths relative to the provided root. * @param {string} rootDir * @param {'preact' | 'react'} buildFor * @return {!{[key: string]: string}}

(rootDir, buildFor = 'preact')

Source from the content-addressed store, hash-verified

85 * @return {!{[key: string]: string}}
86 */
87function getRelativeAliasMap(rootDir, buildFor = 'preact') {
88 return Object.fromEntries(
89 Object.entries(getImportResolver(buildFor).alias).map(
90 ([alias, destPath]) => [alias, path.join(rootDir, destPath)]
91 )
92 );
93}
94
95/**
96 * Import resolver Babel plugin configuration.

Callers 3

webpack.config.jsFile · 0.85
webpack.config.jsFile · 0.85
webpack.config.jsFile · 0.85

Calls 2

getImportResolverFunction · 0.85
entriesMethod · 0.45

Tested by

no test coverage detected