File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
import webpack from 'webpack' ;
2
2
import env from 'std-env' ;
3
3
4
+ import { consola } from './utils/cli' ;
5
+
4
6
import { LogReporter , BarsReporter , ProfileReporter } from './reporters' ;
5
7
import Profile from './profile' ;
6
8
import { parseRequest } from './utils/request' ;
@@ -60,7 +62,11 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
60
62
callReporters ( fn , payload = { } ) {
61
63
for ( const reporter of this . reporters ) {
62
64
if ( typeof reporter [ fn ] === 'function' ) {
63
- reporter [ fn ] ( this , payload ) ;
65
+ try {
66
+ reporter [ fn ] ( this , payload ) ;
67
+ } catch ( e ) {
68
+ consola . error ( e ) ;
69
+ }
64
70
}
65
71
}
66
72
}
Original file line number Diff line number Diff line change 1
1
import prettyTime from 'pretty-time' ;
2
- import Consola from 'consola' ;
3
2
4
- const consola = Consola . withTag ( 'webpackbar' ) ;
3
+ import { consola } from '../utils/cli' ;
5
4
6
5
export default class LogReporter {
7
6
compiling ( context ) {
Original file line number Diff line number Diff line change 1
1
import chalk from 'chalk' ;
2
+ import Consola from 'consola' ;
2
3
3
4
import textTable from 'text-table' ;
4
5
5
6
import { BLOCK_CHAR , BLOCK_CHAR2 , BAR_LENGTH } from './consts' ;
6
7
7
8
import { range } from '.' ;
8
9
10
+ export const consola = Consola . withTag ( 'webpackbar' ) ;
11
+
9
12
export const colorize = ( color ) => {
10
13
if ( color [ 0 ] === '#' ) {
11
14
return chalk . hex ( color ) ;
You can’t perform that action at this time.
0 commit comments