MCPcopy
hub / github.com/webpack/webpack / _cleanupLastCompilation

Method _cleanupLastCompilation

lib/Compiler.js:472–495  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

470 // TODO webpack 6: solve this in a better way
471 // e.g. move compilation specific info from Modules into ModuleGraph
472 _cleanupLastCompilation() {
473 if (this._lastCompilation !== undefined) {
474 for (const childCompilation of this._lastCompilation.children) {
475 for (const module of childCompilation.modules) {
476 ChunkGraph.clearChunkGraphForModule(module);
477 ModuleGraph.clearModuleGraphForModule(module);
478 module.cleanupForCache();
479 }
480 for (const chunk of childCompilation.chunks) {
481 ChunkGraph.clearChunkGraphForChunk(chunk);
482 }
483 }
484
485 for (const module of this._lastCompilation.modules) {
486 ChunkGraph.clearChunkGraphForModule(module);
487 ModuleGraph.clearModuleGraphForModule(module);
488 module.cleanupForCache();
489 }
490 for (const chunk of this._lastCompilation.chunks) {
491 ChunkGraph.clearChunkGraphForChunk(chunk);
492 }
493 this._lastCompilation = undefined;
494 }
495 }
496
497 // TODO webpack 6: solve this in a better way
498 _cleanupLastNormalModuleFactory() {

Callers 1

createCompilationMethod · 0.95

Calls 4

cleanupForCacheMethod · 0.45

Tested by

no test coverage detected