File tree Expand file tree Collapse file tree
packages/@ngtools/webpack/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -307,12 +307,14 @@ function _checkDiagnostics(refactor: TypeScriptFileRefactor) {
307307 * Recursively calls diagnose on the plugins for all the reverse dependencies.
308308 * @private
309309 */
310- function _diagnoseDeps ( reasons : ModuleReason [ ] , plugin : AotPlugin ) {
310+ function _diagnoseDeps ( reasons : ModuleReason [ ] , plugin : AotPlugin , checked : Set < string > ) {
311311 reasons
312312 . filter ( reason => reason && reason . module && reason . module instanceof NormalModule )
313+ . filter ( reason => ! checked . has ( reason . module . resource ) )
313314 . forEach ( reason => {
315+ checked . add ( reason . module . resource ) ;
314316 plugin . diagnose ( reason . module . resource ) ;
315- _diagnoseDeps ( reason . module . reasons , plugin ) ;
317+ _diagnoseDeps ( reason . module . reasons , plugin , checked ) ;
316318 } ) ;
317319}
318320
@@ -344,7 +346,7 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }) {
344346 if ( plugin . typeCheck ) {
345347 // Check all diagnostics from this and reverse dependencies also.
346348 if ( ! plugin . firstRun ) {
347- _diagnoseDeps ( this . _module . reasons , plugin ) ;
349+ _diagnoseDeps ( this . _module . reasons , plugin , new Set < string > ( ) ) ;
348350 }
349351 // We do this here because it will throw on error, resulting in rebuilding this file
350352 // the next time around if it changes.
You can’t perform that action at this time.
0 commit comments