MCPcopy
hub / github.com/webpack/webpack / removeReasonsOfDependencyBlock

Method removeReasonsOfDependencyBlock

lib/Compilation.js:4585–4608  ·  view source on GitHub ↗

* Removes reasons of dependency block. * @param {Module} module module relationship for removal * @param {DependenciesBlockLike} block dependencies block * @returns {void}

(module, block)

Source from the content-addressed store, hash-verified

4583 * @returns {void}
4584 */
4585 removeReasonsOfDependencyBlock(module, block) {
4586 if (block.blocks) {
4587 for (const b of block.blocks) {
4588 this.removeReasonsOfDependencyBlock(module, b);
4589 }
4590 }
4591
4592 if (block.dependencies) {
4593 for (const dep of block.dependencies) {
4594 const originalModule = this.moduleGraph.getModule(dep);
4595 if (originalModule) {
4596 this.moduleGraph.removeConnection(dep);
4597
4598 if (this.chunkGraph) {
4599 for (const chunk of this.chunkGraph.getModuleChunks(
4600 originalModule
4601 )) {
4602 this.patchChunksAfterReasonRemoval(originalModule, chunk);
4603 }
4604 }
4605 }
4606 }
4607 }
4608 }
4609
4610 /**
4611 * Patch chunks after reason removal.

Callers 2

_rebuildModuleMethod · 0.95

Calls 4

removeConnectionMethod · 0.80
getModuleChunksMethod · 0.80
getModuleMethod · 0.45

Tested by

no test coverage detected