@@ -450,11 +450,11 @@ export class BundlerContext {
450450 ? entryPoints . map ( ( entry ) => ( typeof entry === 'string' ? entry : entry . in ) )
451451 : Object . values ( entryPoints ) ;
452452 for ( const entry of entries ) {
453- if ( ! isInternalAngularFile ( entry ) && ! isInternalBundlerFile ( entry ) ) {
454- this . watchFiles . add (
455- isAbsolute ( entry ) ? normalize ( entry ) : join ( this . workspaceRoot , entry ) ,
456- ) ;
453+ if ( isInternalAngularFile ( entry ) || isInternalBundlerFile ( entry ) ) {
454+ continue ;
457455 }
456+
457+ this . watchFiles . add ( isAbsolute ( entry ) ? normalize ( entry ) : join ( this . workspaceRoot , entry ) ) ;
458458 }
459459 }
460460
@@ -474,20 +474,22 @@ export class BundlerContext {
474474
475475 async #addLoadCacheFilesToWatch( ) : Promise < void > {
476476 const loadCache = this . #loadCache;
477- if ( this . incremental && loadCache && this . #loadCacheKeys) {
478- const results = await Promise . all (
479- Array . from ( this . #loadCacheKeys , ( key ) => loadCache . get ( key ) ) ,
480- ) ;
481- for ( const cachedResult of results ) {
482- if ( cachedResult ?. watchFiles ) {
483- for ( const file of cachedResult . watchFiles ) {
484- if ( ! isInternalAngularFile ( file ) ) {
485- this . watchFiles . add (
486- isAbsolute ( file ) ? normalize ( file ) : join ( this . workspaceRoot , file ) ,
487- ) ;
488- }
489- }
477+ if ( ! this . incremental || ! loadCache || ! this . #loadCacheKeys) {
478+ return ;
479+ }
480+
481+ const results = await Promise . all ( Array . from ( this . #loadCacheKeys , ( key ) => loadCache . get ( key ) ) ) ;
482+ for ( const cachedResult of results ) {
483+ if ( ! cachedResult ? .watchFiles ) {
484+ continue ;
485+ }
486+
487+ for ( const file of cachedResult . watchFiles ) {
488+ if ( isInternalAngularFile ( file ) ) {
489+ continue ;
490490 }
491+
492+ this . watchFiles . add ( isAbsolute ( file ) ? normalize ( file ) : join ( this . workspaceRoot , file ) ) ;
491493 }
492494 }
493495 }
0 commit comments