@@ -413,7 +413,7 @@ namespace ts {
413413 // This is because in the -out scenario all files need to be emitted, and therefore all
414414 // files need to be type checked. And the way to specify that all files need to be type
415415 // checked is to not pass the file to getEmitResolver.
416- let emitResolver = getDiagnosticsProducingTypeChecker ( ) . getEmitResolver ( options . out ? undefined : sourceFile ) ;
416+ let emitResolver = getDiagnosticsProducingTypeChecker ( ) . getEmitResolver ( ( options . outFile || options . out ) ? undefined : sourceFile ) ;
417417
418418 let start = new Date ( ) . getTime ( ) ;
419419
@@ -804,6 +804,10 @@ namespace ts {
804804 if ( options . out ) {
805805 diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "out" , "isolatedModules" ) ) ;
806806 }
807+
808+ if ( options . outFile ) {
809+ diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "outFile" , "isolatedModules" ) ) ;
810+ }
807811 }
808812
809813 if ( options . inlineSourceMap ) {
@@ -825,6 +829,10 @@ namespace ts {
825829 }
826830 }
827831
832+ if ( options . out && options . outFile ) {
833+ diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "out" , "outFile" ) ) ;
834+ }
835+
828836 if ( ! options . sourceMap && ( options . mapRoot || options . sourceRoot ) ) {
829837 // Error to specify --mapRoot or --sourceRoot without mapSourceFiles
830838 if ( options . mapRoot ) {
@@ -837,6 +845,7 @@ namespace ts {
837845 }
838846
839847 let languageVersion = options . target || ScriptTarget . ES3 ;
848+ let outFile = options . outFile || options . out ;
840849
841850 let firstExternalModuleSourceFile = forEach ( files , f => isExternalModule ( f ) ? f : undefined ) ;
842851 if ( options . isolatedModules ) {
@@ -866,7 +875,7 @@ namespace ts {
866875 if ( options . outDir || // there is --outDir specified
867876 options . sourceRoot || // there is --sourceRoot specified
868877 ( options . mapRoot && // there is --mapRoot specified and there would be multiple js files generated
869- ( ! options . out || firstExternalModuleSourceFile !== undefined ) ) ) {
878+ ( ! outFile || firstExternalModuleSourceFile !== undefined ) ) ) {
870879
871880 if ( options . rootDir && checkSourceFilesBelongToPath ( files , options . rootDir ) ) {
872881 // If a rootDir is specified and is valid use it as the commonSourceDirectory
@@ -890,6 +899,10 @@ namespace ts {
890899 diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "noEmit" , "out" ) ) ;
891900 }
892901
902+ if ( options . outFile ) {
903+ diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "noEmit" , "outFile" ) ) ;
904+ }
905+
893906 if ( options . outDir ) {
894907 diagnostics . add ( createCompilerDiagnostic ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "noEmit" , "outDir" ) ) ;
895908 }
0 commit comments