From cea4838972896cd36c5e39ff05e6d5ba1b07d857 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 13 Aug 2018 15:19:27 -0700 Subject: [PATCH] Set rootDir in tsconfig-base.json (#26415) --- src/compiler/utilities.ts | 11 +---------- src/tsconfig-base.json | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d5885fe6b95..9b4614f45ce 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3188,16 +3188,7 @@ namespace ts { } export function getDeclarationEmitOutputFilePath(fileName: string, host: EmitHost) { - // TODO: GH#25810 following should work but makes the build break: - // return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f)); - - const options = host.getCompilerOptions(); - const outputDir = options.declarationDir || options.outDir; // Prefer declaration folder if specified - - const path = outputDir - ? getSourceFilePathInNewDir(fileName, host, outputDir) - : fileName; - return removeFileExtension(path) + Extension.Dts; + return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f)); } export function getDeclarationEmitOutputFilePathWorker(fileName: string, options: CompilerOptions, currentDirectory: string, commonSourceDirectory: string, getCanonicalFileName: GetCanonicalFileName): string { diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index acbd4a3574a..a6df4100d9f 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -3,6 +3,7 @@ "pretty": true, "lib": ["es2015"], "target": "es5", + "rootDir": ".", "declaration": true, "declarationMap": true,