File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,23 @@ exports.run = (options) => {
108
108
let project = Manager . getProject ( projectCwd ) ;
109
109
if ( project . check ( ) ) {
110
110
let compiler = project . getServerCompiler ( ) ;
111
- middleware = middlewareCache [ projectName ] = webpackDevMiddleware ( compiler , { noInfo : true } ) ;
111
+ middleware = middlewareCache [ projectName ] = webpackDevMiddleware ( compiler , { quiet : true } ) ;
112
+
113
+ // 输出server运行中 error/warning 信息
114
+ compiler . watch ( { } , function ( err , stats ) {
115
+ const statsInfo = stats . toJson ( { errorDetails : true } ) ,
116
+ logMethods = {
117
+ errors : error ,
118
+ warnings : warn
119
+ } ;
120
+
121
+ Object . keys ( logMethods ) . map ( ( typeId ) => {
122
+ statsInfo [ typeId ] . map ( ( logInfo ) => {
123
+ logMethods [ typeId ] ( logInfo ) ;
124
+ } ) ;
125
+ } ) ;
126
+ } ) ;
127
+
112
128
} else {
113
129
next ( ) ;
114
130
return ;
You can’t perform that action at this time.
0 commit comments