From bb615ac3f9ef30589f1afe8a4487de8938108660 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 11 May 2018 13:47:44 +0300 Subject: [PATCH] Add declarationDir to excludeSpec --- src/compiler/commandLineParser.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f648bddefe9..d9bfc93b78d 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1607,10 +1607,13 @@ namespace ts { createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array"); } } - else { - const outDir = raw.compilerOptions && raw.compilerOptions.outDir; - if (outDir) { - excludeSpecs = [outDir]; + else if (raw.compilerOptions) { + const outDir = raw.compilerOptions.outDir; + const declarationDir = raw.compilerOptions.declarationDir; + const excludeDirs = [outDir, declarationDir].filter(dir => dir); + + if (excludeDirs.length) { + excludeSpecs = excludeDirs; } }