Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: preserve previous webpack stats derived values, even if we restart webpack itself #36980

Merged
merged 1 commit into from Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/gatsby/src/utils/gatsby-webpack-stats-extractor.ts
Expand Up @@ -5,6 +5,9 @@ import { PARTIAL_HYDRATION_CHUNK_REASON } from "./webpack/plugins/partial-hydrat
import { store } from "../redux"
import { ensureFileContent } from "./ensure-file-content"

let previousChunkMapJson: string | undefined
let previousWebpackStatsJson: string | undefined

export class GatsbyWebpackStatsExtractor {
private plugin: { name: string }
private publicPath: string
Expand All @@ -14,8 +17,6 @@ export class GatsbyWebpackStatsExtractor {
this.publicPath = publicPath
}
apply(compiler: Compiler): void {
let previousChunkMapJson: string | undefined
let previousWebpackStatsJson: string | undefined
compiler.hooks.done.tapAsync(this.plugin.name, async (stats, done) => {
const assets: { [key: string]: Array<string> } = {}
const assetsMap = {}
Expand Down