MCPcopy
hub / github.com/webpack/webpack / getForwardedIds

Function getForwardedIds

lib/LazyBarrel.js:44–57  ·  view source on GitHub ↗

* Collects the export names a dependency group requests from its target. * @param {Dependency[]} dependencies dependency group resolving to one module * @returns {Set<string> | true} requested export names, true for all

(dependencies)

Source from the content-addressed store, hash-verified

42 * @returns {Set<string> | true} requested export names, true for all
43 */
44function getForwardedIds(dependencies) {
45 /** @type {Set<string>} */
46 const ids = new Set();
47 for (const dependency of dependencies) {
48 // TODO remove in webpack 6
49 // It may be missing on custom dependency types not extending the base Dependency
50 if (!("getForwardId" in dependency)) continue;
51
52 const id = dependency.getForwardId();
53 if (id === true) return true;
54 if (id !== null) ids.add(id);
55 }
56 return ids;
57}
58
59/**
60 * Tracks the deferred (not yet factorized/built) dependencies of a

Callers 1

requestMethod · 0.85

Calls 2

getForwardIdMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected