Skip to content

Commit cea4838

Browse files
author
Andy
authored
Set rootDir in tsconfig-base.json (microsoft#26415)
1 parent e8b72aa commit cea4838

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/compiler/utilities.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,16 +3188,7 @@ namespace ts {
31883188
}
31893189

31903190
export function getDeclarationEmitOutputFilePath(fileName: string, host: EmitHost) {
3191-
// TODO: GH#25810 following should work but makes the build break:
3192-
// return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f));
3193-
3194-
const options = host.getCompilerOptions();
3195-
const outputDir = options.declarationDir || options.outDir; // Prefer declaration folder if specified
3196-
3197-
const path = outputDir
3198-
? getSourceFilePathInNewDir(fileName, host, outputDir)
3199-
: fileName;
3200-
return removeFileExtension(path) + Extension.Dts;
3191+
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f));
32013192
}
32023193

32033194
export function getDeclarationEmitOutputFilePathWorker(fileName: string, options: CompilerOptions, currentDirectory: string, commonSourceDirectory: string, getCanonicalFileName: GetCanonicalFileName): string {

src/tsconfig-base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"pretty": true,
44
"lib": ["es2015"],
55
"target": "es5",
6+
"rootDir": ".",
67

78
"declaration": true,
89
"declarationMap": true,

0 commit comments

Comments
 (0)