File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1669,6 +1669,10 @@ namespace ts {
1669
1669
programDiagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_without_specifying_option_1 , "sourceRoot" , "sourceMap" ) ) ;
1670
1670
}
1671
1671
}
1672
+
1673
+ if ( ! options . declaration && options . declarationDir ) {
1674
+ programDiagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_without_specifying_option_1 , "declarationDir" , "declaration" ) ) ;
1675
+ }
1672
1676
1673
1677
const languageVersion = options . target || ScriptTarget . ES3 ;
1674
1678
const outFile = options . outFile || options . out ;
Original file line number Diff line number Diff line change @@ -2015,11 +2015,13 @@ namespace ts {
2015
2015
export function getDeclarationEmitOutputFilePath ( sourceFile : SourceFile , host : EmitHost ) {
2016
2016
const options = host . getCompilerOptions ( ) ;
2017
2017
const outputDir = options . declarationDir || options . outDir ; // Prefer declaration folder if specified
2018
- return options . declaration ? removeFileExtension (
2019
- outputDir
2018
+
2019
+ if ( options . declaration ) {
2020
+ const path = outputDir
2020
2021
? getSourceFilePathInNewDir ( sourceFile , host , outputDir )
2021
- : sourceFile . fileName
2022
- ) + ".d.ts" : undefined ;
2022
+ : sourceFile . fileName ;
2023
+ return removeFileExtension ( path ) + ".d.ts" ;
2024
+ }
2023
2025
}
2024
2026
2025
2027
export function getEmitScriptTarget ( compilerOptions : CompilerOptions ) {
You can’t perform that action at this time.
0 commit comments