Skip to content

Commit 11ec01b

Browse files
committed
Merge pull request microsoft#7159 from tinganho/excludeOutDir
Fixes outDir exclude
2 parents 6b05ad7 + 30294c7 commit 11ec01b

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/compiler/tsc.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,16 +710,19 @@ namespace ts {
710710
else {
711711
const compilerOptions = extend(options, defaultInitCompilerOptions);
712712
const configurations: any = {
713-
compilerOptions: serializeCompilerOptions(compilerOptions)
713+
compilerOptions: serializeCompilerOptions(compilerOptions)
714714
};
715715

716716
if (fileNames && fileNames.length) {
717717
// only set the files property if we have at least one file
718718
configurations.files = fileNames;
719719
}
720-
else {
721-
configurations.exclude = ["node_modules"];
722-
}
720+
else {
721+
configurations.exclude = ["node_modules"];
722+
if (compilerOptions.outDir) {
723+
configurations.exclude.push(compilerOptions.outDir);
724+
}
725+
}
723726

724727
sys.writeFile(file, JSON.stringify(configurations, undefined, 4));
725728
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Successfully_created_a_tsconfig_json_file), /* compilerHost */ undefined);

src/server/protocol.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ declare namespace ts.server.protocol {
469469
placeOpenBraceOnNewLineForControlBlocks?: boolean;
470470

471471
/** Index operator */
472-
[key: string] : string | number | boolean;
472+
[key: string]: string | number | boolean;
473473
}
474474

475475
/**

0 commit comments

Comments
 (0)