| 450 | |
| 451 | // modify chunkHash (webpack 4 & 5) |
| 452 | updateChunkHash (compilation) { |
| 453 | const updateWithHash = (chunk, hash) => { |
| 454 | hash.update(NAME); |
| 455 | hash.update(this.serializeOptions()); |
| 456 | }; |
| 457 | |
| 458 | if (this.isWebpack4()) { |
| 459 | compilation.mainTemplate.hooks.hashForChunk.tap(NAME, updateWithHash.bind(null, null)); |
| 460 | compilation.chunkTemplate.hooks.hashForChunk.tap(NAME, updateWithHash.bind(null, null)); |
| 461 | } else { |
| 462 | // @ts-ignore |
| 463 | this.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).chunkHash.tap(NAME, updateWithHash); |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | apply (compiler) { |
| 468 | this.workerPool = new WorkerPool({ |