File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -56,24 +56,42 @@ function build () {
56
56
pack ( mainConfig ) . then ( result => {
57
57
results += result + '\n\n'
58
58
m . success ( 'main' )
59
- } ) . catch ( ( ) => {
59
+ } ) . catch ( err => {
60
60
m . error ( 'main' )
61
+ console . log ( `\n ${ errorLog } failed to build main process` )
62
+ console . error ( `\n${ err } \n` )
63
+ process . exit ( 1 )
61
64
} )
62
65
63
66
pack ( rendererConfig ) . then ( result => {
64
67
results += result + '\n\n'
65
68
m . success ( 'renderer' )
66
- } ) . catch ( ( ) => {
69
+ } ) . catch ( err => {
67
70
m . error ( 'renderer' )
71
+ console . log ( `\n ${ errorLog } failed to build renderer process` )
72
+ console . error ( `\n${ err } \n` )
73
+ process . exit ( 1 )
68
74
} )
69
75
}
70
76
71
77
function pack ( config ) {
72
78
return new Promise ( ( resolve , reject ) => {
73
79
webpack ( config , ( err , stats ) => {
74
80
if ( err ) reject ( err . stack || err )
75
- else if ( stats . hasErrors ( ) ) reject ( stats . toJson ( ) . errors )
76
- else {
81
+ else if ( stats . hasErrors ( ) ) {
82
+ let err = ''
83
+
84
+ stats . toString ( {
85
+ chunks : false ,
86
+ colors : true
87
+ } )
88
+ . split ( / \r ? \n / )
89
+ . forEach ( line => {
90
+ err += ` ${ line } \n`
91
+ } )
92
+
93
+ reject ( err )
94
+ } else {
77
95
resolve ( stats . toString ( {
78
96
chunks : false ,
79
97
colors : true
You can’t perform that action at this time.
0 commit comments