@@ -43,7 +43,7 @@ namespace ts {
43
43
if ( sourceFile . kind === SyntaxKind . Bundle ) {
44
44
const jsFilePath = options . outFile || options . out ! ;
45
45
const sourceMapFilePath = getSourceMapFilePath ( jsFilePath , options ) ;
46
- const declarationFilePath = ( forceDtsPaths || options . declaration ) ? removeFileExtension ( jsFilePath ) + Extension . Dts : undefined ;
46
+ const declarationFilePath = ( forceDtsPaths || getEmitDeclarations ( options ) ) ? removeFileExtension ( jsFilePath ) + Extension . Dts : undefined ;
47
47
const declarationMapPath = getAreDeclarationMapsEnabled ( options ) ? declarationFilePath + ".map" : undefined ;
48
48
const bundleInfoPath = options . references && jsFilePath ? ( removeFileExtension ( jsFilePath ) + infoExtension ) : undefined ;
49
49
return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, bundleInfoPath } ;
@@ -53,7 +53,7 @@ namespace ts {
53
53
const sourceMapFilePath = isJsonSourceFile ( sourceFile ) ? undefined : getSourceMapFilePath ( jsFilePath , options ) ;
54
54
// For legacy reasons (ie, we have baselines capturing the behavior), js files don't report a .d.ts output path - this would only matter if `declaration` and `allowJs` were both on, which is currently an error
55
55
const isJs = isSourceFileJavaScript ( sourceFile ) ;
56
- const declarationFilePath = ( ( forceDtsPaths || options . declaration ) && ! isJs ) ? getDeclarationEmitOutputFilePath ( sourceFile , host ) : undefined ;
56
+ const declarationFilePath = ( ( forceDtsPaths || getEmitDeclarations ( options ) ) && ! isJs ) ? getDeclarationEmitOutputFilePath ( sourceFile , host ) : undefined ;
57
57
const declarationMapPath = getAreDeclarationMapsEnabled ( options ) ? declarationFilePath + ".map" : undefined ;
58
58
return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, bundleInfoPath : undefined } ;
59
59
}
@@ -192,7 +192,7 @@ namespace ts {
192
192
// Setup and perform the transformation to retrieve declarations from the input files
193
193
const nonJsFiles = filter ( sourceFiles , isSourceFileNotJavaScript ) ;
194
194
const inputListOrBundle = ( compilerOptions . outFile || compilerOptions . out ) ? [ createBundle ( nonJsFiles , ! isSourceFile ( sourceFileOrBundle ) ? sourceFileOrBundle . prepends : undefined ) ] : nonJsFiles ;
195
- if ( emitOnlyDtsFiles && ! compilerOptions . declaration ) {
195
+ if ( emitOnlyDtsFiles && ! getEmitDeclarations ( compilerOptions ) ) {
196
196
// Checker wont collect the linked aliases since thats only done when declaration is enabled.
197
197
// Do that here when emitting only dts files
198
198
nonJsFiles . forEach ( collectLinkedAliases ) ;
0 commit comments