Skip to content

Commit

Permalink
fix: clear webpack asset emit cache afterEmit (#127)
Browse files Browse the repository at this point in the history
Fix #126
  • Loading branch information
jbedard authored Nov 3, 2023
1 parent 844840d commit 54faaa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webpack/private/webpack_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class WebpackWorker extends WebpackCLI {
console.error(options)
this.compiler = await super.createCompiler(options, cb)
this.options = options

// The output directory will be cleaned between runs, webpack assumes the output directory will not be modified:
// Webpack5: https://github.com/webpack/webpack/blob/v5.36.2/lib/Compiler.js#L783-L788
if (this.compiler._assetEmittingPreviousFiles) {
this.compiler.hooks.afterEmit.tap("rules_webpack", () => this.compiler._assetEmittingPreviousFiles.clear())
}
}
}
}
Expand Down

0 comments on commit 54faaa6

Please sign in to comment.