Fix the incorrect copy over for watchOptions and fix order of watches for referenced projects (#59871)

This commit is contained in:
Sheetal Nandi
2024-09-05 13:30:08 -07:00
committed by GitHub
parent 87d0e771a8
commit d514dab3f6
9 changed files with 275 additions and 27 deletions
+9 -2
View File
@@ -3267,6 +3267,7 @@ function isSuccessfulParsedTsconfig(value: ParsedTsconfig) {
interface ExtendsResult {
options: CompilerOptions;
watchOptions?: WatchOptions;
watchOptionsCopied?: boolean;
include?: string[];
exclude?: string[];
files?: string[];
@@ -3325,7 +3326,7 @@ function parseConfig(
ownConfig.options = assign(result.options, ownConfig.options);
ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ?
assign(result.watchOptions, ownConfig.watchOptions) :
assignWatchOptions(result, ownConfig.watchOptions) :
ownConfig.watchOptions || result.watchOptions;
}
return ownConfig;
@@ -3355,11 +3356,17 @@ function parseConfig(
}
assign(result.options, extendedConfig.options);
result.watchOptions = result.watchOptions && extendedConfig.watchOptions ?
assign({}, result.watchOptions, extendedConfig.watchOptions) :
assignWatchOptions(result, extendedConfig.watchOptions) :
result.watchOptions || extendedConfig.watchOptions;
// TODO extend type typeAcquisition
}
}
function assignWatchOptions(result: ExtendsResult, watchOptions: WatchOptions) {
if (result.watchOptionsCopied) return assign(result.watchOptions!, watchOptions);
result.watchOptionsCopied = true;
return assign({}, result.watchOptions, watchOptions);
}
}
function parseOwnConfigOfJson(