File tree Expand file tree Collapse file tree
module-trace-disabled-in-error
module-trace-enabled-in-error
watchCases/warnings/warnings-contribute-to-hash Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1103,6 +1103,17 @@ class Compilation extends Tapable {
11031103 for ( let indexChunk = 0 ; indexChunk < chunks . length ; indexChunk ++ ) {
11041104 chunks [ indexChunk ] . sortItems ( ) ;
11051105 }
1106+
1107+ const byMessage = ( a , b ) => {
1108+ const ma = `${ a . message } ` ;
1109+ const mb = `${ b . message } ` ;
1110+ if ( ma < mb ) return - 1 ;
1111+ if ( mb < ma ) return 1 ;
1112+ return 0 ;
1113+ }
1114+
1115+ this . errors . sort ( byMessage ) ;
1116+ this . warnings . sort ( byMessage ) ;
11061117 }
11071118
11081119 summarizeDependencies ( ) {
@@ -1171,6 +1182,12 @@ class Compilation extends Tapable {
11711182 this . children . forEach ( function ( child ) {
11721183 hash . update ( child . hash ) ;
11731184 } ) ;
1185+ this . warnings . forEach ( function ( warning ) {
1186+ hash . update ( `${ warning . message } ` ) ;
1187+ } ) ;
1188+ this . errors . forEach ( function ( warning ) {
1189+ hash . update ( `${ warning . message } ` ) ;
1190+ } ) ;
11741191 // clone needed as sort below is inplace mutation
11751192 const chunks = this . chunks . slice ( ) ;
11761193 /**
Original file line number Diff line number Diff line change 1- Hash: 6e950f2e83663cb6e9a6
1+ Hash: 96df8294017a444709b1
22Time: Xms
33 Asset Size Chunks Chunk Names
44main.js 2.65 kB 0 [emitted] main
Original file line number Diff line number Diff line change 1- Hash: 6e950f2e83663cb6e9a6
1+ Hash: d59adee54681f1f3ab37
22Time: Xms
33 Asset Size Chunks Chunk Names
44main.js 2.65 kB 0 [emitted] main
Original file line number Diff line number Diff line change 1+ Warning1
Original file line number Diff line number Diff line change 1+ require ( "./warning-loader!./changing-file" ) ;
2+
3+ it ( "should detect a change on warnings change" , function ( ) {
4+ switch ( WATCH_STEP ) {
5+ case "0" :
6+ STATE . hash = STATS_JSON . hash ;
7+ break ;
8+ case "1" :
9+ STATS_JSON . hash . should . be . not . eql ( STATE . hash ) ;
10+ break ;
11+ }
12+ } ) ;
Original file line number Diff line number Diff line change 1+ module . exports = function ( source ) {
2+ this . emitWarning ( new Error ( source . trim ( ) ) ) ;
3+ return "" ;
4+ } ;
Original file line number Diff line number Diff line change 1+ module . exports = [
2+ [ / W a r n i n g 1 / ]
3+ ] ;
Original file line number Diff line number Diff line change 1+ New Warning
Original file line number Diff line number Diff line change 1+ module . exports = [
2+ [ / N e w W a r n i n g / ]
3+ ] ;
You can’t perform that action at this time.
0 commit comments