File tree Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Original file line number Diff line number Diff line change 3
3
var webpack = require ( "webpack" ) ;
4
4
var formatOutput = require ( './tools/format-output.js' ) ;
5
5
6
- function DashboardPlugin ( handler ) {
7
- this . logContent = null ;
8
- }
6
+ function DashboardPlugin ( handler ) { }
9
7
10
8
DashboardPlugin . prototype . apply = function ( compiler ) {
11
9
var self = this ;
12
10
var handler = function handler ( dataArr ) {
13
11
14
- if ( self . logContent ) {
15
- return ;
16
- }
17
-
18
12
dataArr . forEach ( function ( data ) {
19
13
switch ( data . type ) {
20
14
// case 'progress':
@@ -64,12 +58,14 @@ DashboardPlugin.prototype.apply = function (compiler) {
64
58
}
65
59
} ;
66
60
if ( stats . hasErrors ( ) ) {
67
- error ( 'Failed' ) ;
61
+ error ( 'Compile Failed.' ) ;
62
+ } else {
63
+ success ( 'Compile Succeed.' ) ;
68
64
}
69
65
// self.logText.log(formatOutput(stats));
70
66
// self.moduleTable.setData(formatModules(stats));
71
67
// self.assetTable.setData(formatAssets(stats));
72
- self . logContent = formatOutput ( stats ) ;
68
+ log ( formatOutput ( stats ) ) ;
73
69
// console.log(formatModules(stats));
74
70
// console.log(formatAssets(stats));
75
71
break ;
@@ -91,10 +87,6 @@ DashboardPlugin.prototype.apply = function (compiler) {
91
87
// }
92
88
}
93
89
} ) ;
94
-
95
- if ( self . logContent ) {
96
- log ( self . logContent ) ;
97
- }
98
90
} ;
99
91
100
92
compiler . apply ( new webpack . ProgressPlugin ( function ( percent , msg ) {
Original file line number Diff line number Diff line change @@ -4,17 +4,13 @@ const webpack = require("webpack");
4
4
const formatOutput = require ( './tools/format-output.js' ) ;
5
5
6
6
function DashboardPlugin ( handler ) {
7
- this . logContent = null ;
7
+
8
8
}
9
9
10
10
DashboardPlugin . prototype . apply = function ( compiler ) {
11
11
var self = this ;
12
12
var handler = function ( dataArr ) {
13
13
14
- if ( self . logContent ) {
15
- return
16
- }
17
-
18
14
dataArr . forEach ( function ( data ) {
19
15
switch ( data . type ) {
20
16
// case 'progress':
@@ -64,12 +60,14 @@ DashboardPlugin.prototype.apply = function(compiler) {
64
60
}
65
61
} ;
66
62
if ( stats . hasErrors ( ) ) {
67
- error ( 'Failed' ) ;
63
+ error ( 'Compile Failed.' ) ;
64
+ } else {
65
+ success ( 'Compile Succeed.' )
68
66
}
69
67
// self.logText.log(formatOutput(stats));
70
68
// self.moduleTable.setData(formatModules(stats));
71
69
// self.assetTable.setData(formatAssets(stats));
72
- self . logContent = formatOutput ( stats ) ;
70
+ log ( formatOutput ( stats ) ) ;
73
71
// console.log(formatModules(stats));
74
72
// console.log(formatAssets(stats));
75
73
break ;
@@ -91,10 +89,6 @@ DashboardPlugin.prototype.apply = function(compiler) {
91
89
// }
92
90
}
93
91
} ) ;
94
-
95
- if ( self . logContent ) {
96
- log ( self . logContent )
97
- }
98
92
} ;
99
93
100
94
compiler . apply ( new webpack . ProgressPlugin ( function ( percent , msg ) {
You can’t perform that action at this time.
0 commit comments