@@ -159,10 +159,8 @@ class DashboardPlugin {
159159
160160 webpackHook ( compiler , "done" , stats => {
161161 const options = stats . compilation . options ;
162- const statsOptions
163- = options . devServer && options . devServer . stats
164- || options . stats
165- || { colors : true } ;
162+ const statsOptions = ( options . devServer && options . devServer . stats ) ||
163+ options . stats || { colors : true } ;
166164
167165 handler ( [
168166 {
@@ -207,33 +205,40 @@ class DashboardPlugin {
207205 observeMetrics ( statsObj ) {
208206 const statsToObserve = statsObj . toJson ( ) ;
209207
210- const getSizes = stats => actions ( "sizes" , { stats } )
211- . then ( instance => instance . getData ( ) )
212- . then ( data => ( {
213- type : "sizes" ,
214- value : data
215- } ) )
216- . catch ( err => ( {
217- type : "sizes" ,
218- error : true ,
219- value : serializeError ( err )
220- } ) ) ;
221-
222- const getProblems = stats => Promise
223- . all ( INSPECTPACK_PROBLEM_ACTIONS . map ( action => actions ( action , { stats } )
208+ const getSizes = stats =>
209+ actions ( "sizes" , { stats } )
224210 . then ( instance => instance . getData ( ) )
225- ) )
226- . then ( datas => ( {
227- type : INSPECTPACK_PROBLEM_TYPE ,
228- value : INSPECTPACK_PROBLEM_ACTIONS . reduce ( ( memo , action , i ) => Object . assign ( { } , memo , {
229- [ action ] : datas [ i ]
230- } ) , { } )
231- } ) )
232- . catch ( err => ( {
233- type : INSPECTPACK_PROBLEM_TYPE ,
234- error : true ,
235- value : serializeError ( err )
236- } ) ) ;
211+ . then ( data => ( {
212+ type : "sizes" ,
213+ value : data
214+ } ) )
215+ . catch ( err => ( {
216+ type : "sizes" ,
217+ error : true ,
218+ value : serializeError ( err )
219+ } ) ) ;
220+
221+ const getProblems = stats =>
222+ Promise . all (
223+ INSPECTPACK_PROBLEM_ACTIONS . map ( action =>
224+ actions ( action , { stats } ) . then ( instance => instance . getData ( ) )
225+ )
226+ )
227+ . then ( datas => ( {
228+ type : INSPECTPACK_PROBLEM_TYPE ,
229+ value : INSPECTPACK_PROBLEM_ACTIONS . reduce (
230+ ( memo , action , i ) =>
231+ Object . assign ( { } , memo , {
232+ [ action ] : datas [ i ]
233+ } ) ,
234+ { }
235+ )
236+ } ) )
237+ . catch ( err => ( {
238+ type : INSPECTPACK_PROBLEM_TYPE ,
239+ error : true ,
240+ value : serializeError ( err )
241+ } ) ) ;
237242
238243 const sizesStream = most . of ( statsToObserve ) . map ( getSizes ) ;
239244 const problemsStream = most . of ( statsToObserve ) . map ( getProblems ) ;
0 commit comments