MCPcopy
hub / github.com/webpack/webpack / addLazy

Method addLazy

lib/LazyBarrel.js:82–89  ·  view source on GitHub ↗

* Records a deferred dependency under its request key. * @param {string} requestKey request key * @param {Dependency} dependency dependency to defer * @param {ModuleFactory} factory factory for the request * @param {string | undefined} context request context

(requestKey, dependency, factory, context)

Source from the content-addressed store, hash-verified

80 * @param {string | undefined} context request context
81 */
82 addLazy(requestKey, dependency, factory, context) {
83 let group = this._requestToDepGroup.get(requestKey);
84 if (group === undefined) {
85 group = { factory, dependencies: [], context };
86 this._requestToDepGroup.set(requestKey, group);
87 }
88 group.dependencies.push(dependency);
89 }
90
91 /**
92 * Maps an export name to the request providing it.

Callers 1

classifyMethod · 0.80

Calls 3

getMethod · 0.45
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected