File tree 1 file changed +20
-3
lines changed
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,28 @@ module.exports = (api, options) => {
33
33
const onCompilationComplete = ( err , stats ) => {
34
34
if ( err ) {
35
35
// 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
+ }
37
41
return
38
42
}
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
+ }
41
58
}
42
59
43
60
if ( args . watch ) {
You can’t perform that action at this time.
0 commit comments