tsconfig.json中的'outDir'是如何解决的?
How is 'outDir' in tsconfig.json resolved?
baseUrl 或当前工作目录会影响它吗?
而且,更一般地说,这在哪里记录?
它似乎没有在任何地方记录,但它是相对于 tsconfig.json
文件的目录解析的,不受 baseUrl
的影响 - baseUrl
仅用于模块解析.
The source,稍微重新格式化:
const result = parseJsonText(configFileName, configFileText);
const cwd = host.getCurrentDirectory();
return parseJsonSourceFileConfigFileContent(
result,
host,
getNormalizedAbsolutePath(getDirectoryPath(configFileName), cwd),
optionsToExtend,
getNormalizedAbsolutePath(configFileName, cwd)
);
parseJsonSourceFileConfigFileContent
的第三个参数是解析 tsconfig.json
中相对路径的基础,如您所见,它来自 configFileName
,它是 tsconfig.json
的名称文件。
baseUrl 或当前工作目录会影响它吗? 而且,更一般地说,这在哪里记录?
它似乎没有在任何地方记录,但它是相对于 tsconfig.json
文件的目录解析的,不受 baseUrl
的影响 - baseUrl
仅用于模块解析.
The source,稍微重新格式化:
const result = parseJsonText(configFileName, configFileText);
const cwd = host.getCurrentDirectory();
return parseJsonSourceFileConfigFileContent(
result,
host,
getNormalizedAbsolutePath(getDirectoryPath(configFileName), cwd),
optionsToExtend,
getNormalizedAbsolutePath(configFileName, cwd)
);
parseJsonSourceFileConfigFileContent
的第三个参数是解析 tsconfig.json
中相对路径的基础,如您所见,它来自 configFileName
,它是 tsconfig.json
的名称文件。