|
1 |
| -namespace ts { |
| 1 | + namespace ts { |
2 | 2 | /* @internal */
|
3 | 3 | export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" };
|
4 | 4 |
|
@@ -675,7 +675,7 @@ namespace ts {
|
675 | 675 | name: "out",
|
676 | 676 | type: "string",
|
677 | 677 | affectsEmit: true,
|
678 |
| - isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files |
| 678 | + isFilePath: false, // This is intentionally broken to support compatibility with existing tsconfig files |
679 | 679 | // for correct behaviour, please use outFile
|
680 | 680 | category: Diagnostics.Advanced_Options,
|
681 | 681 | paramType: Diagnostics.FILE,
|
@@ -1049,6 +1049,7 @@ namespace ts {
|
1049 | 1049 | errors
|
1050 | 1050 | };
|
1051 | 1051 |
|
| 1052 | + |
1052 | 1053 | function parseStrings(args: ReadonlyArray<string>) {
|
1053 | 1054 | let i = 0;
|
1054 | 1055 | while (i < args.length) {
|
@@ -2056,8 +2057,20 @@ namespace ts {
|
2056 | 2057 | Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined));
|
2057 | 2058 | const errors: Diagnostic[] = [];
|
2058 | 2059 |
|
| 2060 | + function makeFilesAbsolute(optionsFromCLI: CompilerOptions) { |
| 2061 | + Object.keys(optionsFromCLI).forEach(key => { |
| 2062 | + const optionForKey = getOptionDeclarationFromName(getOptionNameMap, key, /*allowShort*/ true); |
| 2063 | + const value = optionsFromCLI[key]; |
| 2064 | + const relative = isString(value) && !isRootedDiskPath(value); |
| 2065 | + if (relative && optionForKey && optionForKey.isFilePath && configFileName) { |
| 2066 | + optionsFromCLI[key] = getNormalizedAbsolutePath(value as string, getDirectoryPath(configFileName)); |
| 2067 | + } |
| 2068 | + }); |
| 2069 | + } |
| 2070 | + |
2059 | 2071 | const parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache);
|
2060 | 2072 | const { raw } = parsedConfig;
|
| 2073 | + makeFilesAbsolute(existingOptions); |
2061 | 2074 | const options = extend(existingOptions, parsedConfig.options || {});
|
2062 | 2075 | options.configFilePath = configFileName && normalizeSlashes(configFileName);
|
2063 | 2076 | setConfigFileInOptions(options, sourceFile);
|
|
0 commit comments