1
1
import chalk from 'chalk' ;
2
2
import type webpack from 'webpack' ;
3
3
4
+ import { statsFormatter } from '../formatter/stats-formatter' ;
4
5
import { createWebpackFormatter } from '../formatter/webpack-formatter' ;
5
6
import { getInfrastructureLogger } from '../infrastructure-logger' ;
6
7
import type { Issue } from '../issue' ;
@@ -17,7 +18,7 @@ function tapDoneToAsyncGetIssues(
17
18
state : ForkTsCheckerWebpackPluginState
18
19
) {
19
20
const hooks = getPluginHooks ( compiler ) ;
20
- const { log , debug } = getInfrastructureLogger ( compiler ) ;
21
+ const { debug } = getInfrastructureLogger ( compiler ) ;
21
22
22
23
compiler . hooks . done . tap ( 'ForkTsCheckerWebpackPlugin' , async ( stats ) => {
23
24
if ( stats . compilation . compiler !== compiler ) {
@@ -31,7 +32,7 @@ function tapDoneToAsyncGetIssues(
31
32
try {
32
33
if ( await isPending ( issuesPromise ) ) {
33
34
hooks . waiting . call ( stats . compilation ) ;
34
- config . logger . log ( chalk . cyan ( 'Issues checking in progress...' ) ) ;
35
+ config . logger . log ( chalk . cyan ( 'Type- checking in progress...' ) ) ;
35
36
} else {
36
37
// wait 10ms to log issues after webpack stats
37
38
await wait ( 10 ) ;
@@ -60,8 +61,11 @@ function tapDoneToAsyncGetIssues(
60
61
if ( issues . length ) {
61
62
// follow webpack's approach - one process.write to stderr with all errors and warnings
62
63
config . logger . error ( issues . map ( ( issue ) => formatter ( issue ) ) . join ( '\n' ) ) ;
64
+
65
+ // print stats of the compilation
66
+ config . logger . log ( statsFormatter ( issues , stats ) ) ;
63
67
} else {
64
- config . logger . log ( chalk . green ( 'No issues found.' ) ) ;
68
+ config . logger . log ( chalk . green ( 'No errors found.' ) ) ;
65
69
}
66
70
67
71
// report issues to webpack-dev-server, if it's listening
@@ -80,10 +84,6 @@ function tapDoneToAsyncGetIssues(
80
84
debug ( 'Sending issues to the webpack-dev-server.' ) ;
81
85
state . webpackDevServerDoneTap . fn ( stats ) ;
82
86
}
83
-
84
- if ( stats . startTime ) {
85
- log ( `Time: ${ Math . round ( Date . now ( ) - stats . startTime ) . toString ( ) } ms` ) ;
86
- }
87
87
} ) ;
88
88
}
89
89
0 commit comments