Skip to content

Commit c7fcf2d

Browse files
committed
chore(bundler-webpack): fix webpack types update
1 parent 4ab744c commit c7fcf2d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/@vuepress/bundler-webpack/src/build/createBuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ export const createBuild = (
4040
if (err) {
4141
reject(err)
4242
} else if (stats?.hasErrors()) {
43-
stats.toJson().errors.forEach((err) => {
43+
stats.toJson().errors?.forEach((err) => {
4444
console.error(err)
4545
})
4646
reject(new Error('Failed to compile with errors'))
4747
} else {
4848
if (stats?.hasWarnings()) {
49-
stats.toJson().warnings.forEach((warning) => {
49+
stats.toJson().warnings?.forEach((warning) => {
5050
console.warn(warning)
5151
})
5252
}

packages/@vuepress/bundler-webpack/src/build/ssr/createClientPlugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export const createClientPlugin = (
2424
'vuepress-client-plugin',
2525
async (compilation) => {
2626
// get webpack stats object
27-
const stats: StatsToJsonOutput = compilation.getStats().toJson()
27+
const stats: StatsToJsonOutput = (compilation
28+
.getStats()
29+
.toJson() as unknown) as StatsToJsonOutput
2830

2931
const {
3032
assets = [],

0 commit comments

Comments
 (0)