File tree Expand file tree Collapse file tree
packages/angular/build/src/tools/esbuild Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ class WatcherQueue {
145145
146146 constructor (
147147 private readonly debounceMs = 100 ,
148- private readonly maxWaitMs = 250 ,
148+ private readonly maxWaitMs = 500 ,
149149 ) { }
150150
151151 addChange ( type : 'added' | 'modified' | 'removed' , file : string ) : void {
@@ -527,7 +527,16 @@ async function createChokidarWatcher(
527527) : Promise < BuildWatcher > {
528528 const chokidar = chokidarModule ?? ( await import ( 'chokidar' ) ) ;
529529 const watchedFiles = new Set < string > ( ) ;
530- const queue = new WatcherQueue ( ) ;
530+
531+ let queue : WatcherQueue ;
532+ if ( options ?. polling ) {
533+ const pollingInterval = options . interval ?? 100 ;
534+ const debounceMs = Math . min ( 250 , Math . max ( 100 , Math . ceil ( pollingInterval * 1.5 ) ) ) ;
535+ const maxWaitMs = Math . max ( 500 , debounceMs * 3 ) ;
536+ queue = new WatcherQueue ( debounceMs , maxWaitMs ) ;
537+ } else {
538+ queue = new WatcherQueue ( ) ;
539+ }
531540
532541 const rootDir = options ?. cwd ?? process . cwd ( ) ;
533542 const isCaseSensitive = isFileSystemCaseSensitive ( rootDir ) ;
You can’t perform that action at this time.
0 commit comments