File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,11 +33,28 @@ module.exports = (api, options) => {
3333 const onCompilationComplete = ( err , stats ) => {
3434 if ( err ) {
3535 // eslint-disable-next-line
36- console . error ( err ) ;
36+ console . error ( err . stack || err )
37+ if ( err . details ) {
38+ // eslint-disable-next-line
39+ console . error ( err . details )
40+ }
3741 return
3842 }
39- // eslint-disable-next-line
40- console . log ( formatStats ( stats , options . outputDir , api ) ) ;
43+
44+ if ( stats . hasErrors ( ) ) {
45+ stats . toJson ( ) . errors . forEach ( err => console . error ( err ) )
46+ process . exitCode = 1
47+ }
48+
49+ if ( stats . hasWarnings ( ) ) {
50+ stats . toJson ( ) . warnings . forEach ( warn => console . warn ( warn ) )
51+ }
52+
53+ try {
54+ // eslint-disable-next-line
55+ console . log ( formatStats ( stats , options . outputDir , api ) ) ;
56+ } catch ( e ) {
57+ }
4158 }
4259
4360 if ( args . watch ) {
You can’t perform that action at this time.
0 commit comments