mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Allow 'paths' without 'baseUrl' (#40101)
* Allow paths without baseUrl * Remove exception for leading * paths * Add comment, remove commented code * Update baselines * Remove unnecessary default * Fix test harness * Fix baseline * Resolve relative to host.getCurrentDirectory() with createProgram API
This commit is contained in:
@@ -2509,6 +2509,13 @@ namespace ts {
|
||||
parseOwnConfigOfJson(json, host, basePath, configFileName, errors) :
|
||||
parseOwnConfigOfJsonSourceFile(sourceFile!, host, basePath, configFileName, errors);
|
||||
|
||||
if (ownConfig.options?.paths) {
|
||||
// If we end up needing to resolve relative paths from 'paths' relative to
|
||||
// the config file location, we'll need to know where that config file was.
|
||||
// Since 'paths' can be inherited from an extended config in another directory,
|
||||
// we wouldn't know which directory to use unless we store it here.
|
||||
ownConfig.options.pathsBasePath = basePath;
|
||||
}
|
||||
if (ownConfig.extendedConfigPath) {
|
||||
// copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios.
|
||||
resolutionStack = resolutionStack.concat([resolvedPath]);
|
||||
|
||||
Reference in New Issue
Block a user