File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
development/webpack/utils
plugins/ReactCompilerPlugin Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,21 @@ class ReactCompilerLogger {
8989 console . log ( ` 🔍 Unsupported: ${ stats . unsupported } files` ) ;
9090 console . log ( ` 📦 Total processed: ${ stats . total } files` ) ;
9191 }
92+
93+ /**
94+ * Reset all statistics. Should be called after each build in watch mode
95+ * to prevent accumulation across rebuilds.
96+ */
97+ reset ( ) {
98+ this . compiledCount = 0 ;
99+ this . skippedCount = 0 ;
100+ this . errorCount = 0 ;
101+ this . todoCount = 0 ;
102+ this . compiledFiles = [ ] ;
103+ this . skippedFiles = [ ] ;
104+ this . errorFiles = [ ] ;
105+ this . todoFiles = [ ] ;
106+ }
92107}
93108
94109const reactCompilerLogger = new ReactCompilerLogger ( ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export class ReactCompilerPlugin {
66 compiler . hooks . afterEmit . tap ( ReactCompilerPlugin . name , ( ) => {
77 const logger = getReactCompilerLogger ( ) ;
88 logger . logSummary ( ) ;
9+ // Reset statistics after logging to prevent accumulation in watch mode
10+ logger . reset ( ) ;
911 } ) ;
1012 }
1113}
You can’t perform that action at this time.
0 commit comments