@@ -816,16 +816,20 @@ export class AngularCompilerPlugin implements Tapable {
816
816
. map ( ( p ) => this . _compilerHost . denormalizePath ( p ) ) ;
817
817
}
818
818
} else {
819
- // Check if the TS file exists.
820
- if ( fileName . endsWith ( '.ts' ) && ! this . _compilerHost . fileExists ( fileName , false ) ) {
821
- throw new Error ( `${ fileName } is not part of the compilation. `
822
- + `Please make sure it is in your tsconfig via the 'files' or 'include' property.` ) ;
823
- }
819
+ // Check if the TS input file and the JS output file exist.
820
+ if ( ( fileName . endsWith ( '.ts' ) && ! this . _compilerHost . fileExists ( fileName , false ) )
821
+ || ! this . _compilerHost . fileExists ( outputFile , false ) ) {
822
+ let msg = `${ fileName } is missing from the TypeScript compilation. `
823
+ + `Please make sure it is in your tsconfig via the 'files' or 'include' property.` ;
824
+
825
+ if ( / ( \\ | \/ ) n o d e _ m o d u l e s ( \\ | \/ ) / . test ( fileName ) ) {
826
+ msg += '\nThe missing file seems to be part of a third party library. '
827
+ + 'TS files in published libraries are often a sign of a badly packaged library. '
828
+ + 'Please open an issue in the library repository to alert its author and ask them '
829
+ + 'to package the library using the Angular Package Format (https://goo.gl/jB3GVv).' ;
830
+ }
824
831
825
- // Check if the output file exists.
826
- if ( ! this . _compilerHost . fileExists ( outputFile , false ) ) {
827
- throw new Error ( `${ fileName } is not part of the compilation output. `
828
- + `Please check the other error messages for details.` ) ;
832
+ throw new Error ( msg ) ;
829
833
}
830
834
831
835
outputText = this . _compilerHost . readFile ( outputFile ) ;
0 commit comments