File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ webpack v${webpack.version}
81
81
}
82
82
83
83
let config = { } ;
84
+ let lastHash ;
84
85
let watchConfig ;
85
86
86
87
if ( ! argv . config && existsSync ( defaultConfigPath ) ) {
@@ -124,6 +125,13 @@ webpack v${webpack.version}
124
125
return ;
125
126
}
126
127
128
+ if ( lastHash === stats . hash ) {
129
+ log . info ( chalk `{dim ⁿᵃⁿᵒ} Duplicate build detected {dim (${ lastHash } )}\n` ) ;
130
+ return ;
131
+ }
132
+
133
+ lastHash = stats . hash ;
134
+
127
135
const statsDefaults = { colors : chalk . supportsColor . hasBasic , exclude : [ 'node_modules' ] } ;
128
136
const { options = { } } =
129
137
[ ]
@@ -135,7 +143,8 @@ webpack v${webpack.version}
135
143
: options . stats ;
136
144
const result = stats . toString ( statsOptions ) ;
137
145
138
- log . info ( result ) ;
146
+ // indent the result slightly to visually set it apart from other output
147
+ log . info ( result . split ( '\n' ) . join ( '\n ' ) , '\n' ) ;
139
148
} ;
140
149
141
150
if ( watchConfig ) {
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ Generated by [AVA](https://ava.li).
36
36
_: [
37
37
'undefined',
38
38
],
39
- }
39
+ }
40
+
41
+ ## stats
42
+
43
+ > Snapshot 1
44
+
45
+ `⬡ webpack: Build Finished␊
46
+ ⬡ webpack: 1 module ␊
47
+ `
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ test('multi', async (t) => {
68
68
69
69
test ( 'stats' , async ( t ) => {
70
70
const { stderr } = await run ( '--config' , 'stats.config.js' ) ;
71
- t . is ( stderr , '⬡ webpack: Build Finished\n⬡ webpack: 1 module' ) ;
71
+ t . snapshot ( stderr ) ;
72
72
} ) ;
73
73
74
74
test ( 'watch' , ( t ) => {
You can’t perform that action at this time.
0 commit comments