File tree 2 files changed +5
-3
lines changed
packages/@vuepress/bundler-webpack/src/build
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ export const createBuild = (
40
40
if ( err ) {
41
41
reject ( err )
42
42
} else if ( stats ?. hasErrors ( ) ) {
43
- stats . toJson ( ) . errors . forEach ( ( err ) => {
43
+ stats . toJson ( ) . errors ? .forEach ( ( err ) => {
44
44
console . error ( err )
45
45
} )
46
46
reject ( new Error ( 'Failed to compile with errors' ) )
47
47
} else {
48
48
if ( stats ?. hasWarnings ( ) ) {
49
- stats . toJson ( ) . warnings . forEach ( ( warning ) => {
49
+ stats . toJson ( ) . warnings ? .forEach ( ( warning ) => {
50
50
console . warn ( warning )
51
51
} )
52
52
}
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ export const createClientPlugin = (
24
24
'vuepress-client-plugin' ,
25
25
async ( compilation ) => {
26
26
// get webpack stats object
27
- const stats : StatsToJsonOutput = compilation . getStats ( ) . toJson ( )
27
+ const stats : StatsToJsonOutput = ( compilation
28
+ . getStats ( )
29
+ . toJson ( ) as unknown ) as StatsToJsonOutput
28
30
29
31
const {
30
32
assets = [ ] ,
You can’t perform that action at this time.
0 commit comments