@@ -27,16 +27,31 @@ WebpackNotifierPlugin.prototype.compileMessage = function(stats) {
27
27
28
28
this . lastBuildSucceeded = false ;
29
29
30
- var message ;
31
- if ( error . module && error . module . rawRequest )
32
- message = error . module . rawRequest + '\n' ;
30
+ var rawRequest , resource , line , column ;
33
31
34
- if ( error . error )
35
- message = 'Error: ' + message + error . error . toString ( ) ;
36
- else if ( error . warning )
37
- message = 'Warning: ' + message + error . warning . toString ( ) ;
32
+ if ( error . module ) {
33
+ rawRequest = error . module . rawRequest ;
34
+ resource = error . module . resource ;
35
+ }
36
+
37
+ var errorOrWarning = error . error || error . warning ;
38
+ if ( errorOrWarning && errorOrWarning . loc ) {
39
+ line = errorOrWarning . loc . line ;
40
+ column = errorOrWarning . loc . column ;
41
+ }
42
+
43
+ var body = error . error ? 'Error: ' : error . warning ? 'Warning: ' : '' +
44
+ rawRequest ? rawRequest + '\n' : '' +
45
+ errorOrWarning ? errorOrWarning . toString ( ) : '' ;
38
46
39
- return message ;
47
+ return {
48
+ body : body ,
49
+ location : {
50
+ file : file ,
51
+ line : line ,
52
+ column : column
53
+ }
54
+ } ;
40
55
} ;
41
56
42
57
WebpackNotifierPlugin . prototype . compilationDone = function ( stats ) {
@@ -47,7 +62,7 @@ WebpackNotifierPlugin.prototype.compilationDone = function(stats) {
47
62
48
63
notifier . notify ( {
49
64
title : this . options . title || 'Webpack' ,
50
- message : msg ,
65
+ message : msg . body ,
51
66
contentImage : contentImage ,
52
67
icon : ( os . platform ( ) === 'win32' ) ? contentImage : undefined
53
68
} ) ;
0 commit comments