MCPcopy Index your code
hub / github.com/angular/angular / getExtendedConfigPathWorker

Function getExtendedConfigPathWorker

packages/compiler-cli/src/perform_compile.ts:209–236  ·  view source on GitHub ↗
(
  configFile: string,
  extendsValue: string,
  host: ConfigurationHost,
  fs: FileSystem,
)

Source from the content-addressed store, hash-verified

207}
208
209function getExtendedConfigPathWorker(
210 configFile: string,
211 extendsValue: string,
212 host: ConfigurationHost,
213 fs: FileSystem,
214): AbsoluteFsPath | null {
215 if (extendsValue.startsWith('.') || fs.isRooted(extendsValue)) {
216 const extendedConfigPath = host.resolve(host.dirname(configFile), extendsValue);
217 if (host.exists(extendedConfigPath)) {
218 return extendedConfigPath;
219 }
220 } else {
221 const parseConfigHost = createParseConfigHost(host, fs);
222
223 // Path isn't a rooted or relative path, resolve like a module.
224 const {resolvedModule} = ts.nodeModuleNameResolver(
225 extendsValue,
226 configFile,
227 {moduleResolution: ts.ModuleResolutionKind.NodeNext, resolveJsonModule: true},
228 parseConfigHost,
229 );
230 if (resolvedModule) {
231 return absoluteFrom(resolvedModule.resolvedFileName);
232 }
233 }
234
235 return null;
236}
237
238export interface PerformCompilationResult {
239 diagnostics: ReadonlyArray<ts.Diagnostic>;

Callers 1

getExtendedConfigPathFunction · 0.85

Calls 6

absoluteFromFunction · 0.90
createParseConfigHostFunction · 0.85
isRootedMethod · 0.65
resolveMethod · 0.65
dirnameMethod · 0.65
existsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…