MCPcopy
hub / github.com/webpack/webpack / cloneModuleAttributes

Method cloneModuleAttributes

lib/ModuleGraph.js:417–425  ·  view source on GitHub ↗

* Clones module attributes. * @param {Module} sourceModule the source module * @param {Module} targetModule the target module * @returns {void}

(sourceModule, targetModule)

Source from the content-addressed store, hash-verified

415 * @returns {void}
416 */
417 cloneModuleAttributes(sourceModule, targetModule) {
418 const oldMgm = this._getModuleGraphModule(sourceModule);
419 const newMgm = this._getModuleGraphModule(targetModule);
420 newMgm.postOrderIndex = oldMgm.postOrderIndex;
421 newMgm.preOrderIndex = oldMgm.preOrderIndex;
422 newMgm.depth = oldMgm.depth;
423 newMgm.exports = oldMgm.exports;
424 newMgm.async = oldMgm.async;
425 }
426
427 /**
428 * Removes module attributes.

Callers 1

integrateMethod · 0.80

Calls 1

_getModuleGraphModuleMethod · 0.95

Tested by

no test coverage detected