@@ -26,11 +26,9 @@ export function statsToString(json: any, statsConfig: any) {
26
26
const g = ( x : string ) => colors ? bold ( green ( x ) ) : x ;
27
27
const y = ( x : string ) => colors ? bold ( yellow ( x ) ) : x ;
28
28
29
- return rs ( stripIndents `
30
- Date: ${ w ( new Date ( ) . toISOString ( ) ) }
31
- Hash: ${ w ( json . hash ) }
32
- Time: ${ w ( '' + json . time ) } ms
33
- ${ json . chunks . map ( ( chunk : any ) => {
29
+ const changedChunksStats = json . chunks
30
+ . filter ( ( chunk : any ) => chunk . rendered )
31
+ . map ( ( chunk : any ) => {
34
32
const asset = json . assets . filter ( ( x : any ) => x . name == chunk . files [ 0 ] ) [ 0 ] ;
35
33
const size = asset ? ` ${ _formatSize ( asset . size ) } ` : '' ;
36
34
const files = chunk . files . join ( ', ' ) ;
@@ -41,8 +39,24 @@ export function statsToString(json: any, statsConfig: any) {
41
39
. join ( '' ) ;
42
40
43
41
return `chunk {${ y ( chunk . id ) } } ${ g ( files ) } ${ names } ${ size } ${ initial } ${ flags } ` ;
44
- } ) . join ( '\n' ) }
45
- ` ) ;
42
+ } ) ;
43
+
44
+ const unchangedChunkNumber = json . chunks . length - changedChunksStats . length ;
45
+
46
+ if ( unchangedChunkNumber > 0 ) {
47
+ return rs ( stripIndents `
48
+ Date: ${ w ( new Date ( ) . toISOString ( ) ) } • Hash: ${ w ( json . hash ) } • Time: ${ w ( '' + json . time ) } ms
49
+ ${ unchangedChunkNumber } unchanged chunks
50
+ ${ changedChunksStats . join ( '\n' ) }
51
+ ` ) ;
52
+ } else {
53
+ return rs ( stripIndents `
54
+ Date: ${ w ( new Date ( ) . toISOString ( ) ) }
55
+ Hash: ${ w ( json . hash ) }
56
+ Time: ${ w ( '' + json . time ) } ms
57
+ ${ changedChunksStats . join ( '\n' ) }
58
+ ` ) ;
59
+ }
46
60
}
47
61
48
62
export function statsWarningsToString ( json : any , statsConfig : any ) {
0 commit comments