Skip to content

Commit bc7ac84

Browse files
authored
chore: preserve previous webpack stats derived values, even if we restart webpack itself (#36980)
1 parent 2b5af32 commit bc7ac84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/gatsby/src/utils/gatsby-webpack-stats-extractor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { PARTIAL_HYDRATION_CHUNK_REASON } from "./webpack/plugins/partial-hydrat
55
import { store } from "../redux"
66
import { ensureFileContent } from "./ensure-file-content"
77

8+
let previousChunkMapJson: string | undefined
9+
let previousWebpackStatsJson: string | undefined
10+
811
export class GatsbyWebpackStatsExtractor {
912
private plugin: { name: string }
1013
private publicPath: string
@@ -14,8 +17,6 @@ export class GatsbyWebpackStatsExtractor {
1417
this.publicPath = publicPath
1518
}
1619
apply(compiler: Compiler): void {
17-
let previousChunkMapJson: string | undefined
18-
let previousWebpackStatsJson: string | undefined
1920
compiler.hooks.done.tapAsync(this.plugin.name, async (stats, done) => {
2021
const assets: { [key: string]: Array<string> } = {}
2122
const assetsMap = {}

0 commit comments

Comments
 (0)