MCPcopy
hub / github.com/webpack/webpack / getOutgoingAsyncModules

Function getOutgoingAsyncModules

lib/async-modules/AsyncModuleHelpers.js:21–51  ·  view source on GitHub ↗
(moduleGraph, module)

Source from the content-addressed store, hash-verified

19 * @returns {Modules} set of modules
20 */
21const getOutgoingAsyncModules = (moduleGraph, module) => {
22 /** @type {Modules} */
23 const set = new Set();
24 /** @type {Modules} */
25 const seen = new Set();
26 (function g(module) {
27 if (!moduleGraph.isAsync(module) || seen.has(module)) return;
28 seen.add(module);
29 if (module.buildMeta && module.buildMeta.async) {
30 set.add(module);
31 } else {
32 const outgoingConnectionMap =
33 moduleGraph.getOutgoingConnectionsByModule(module);
34 if (outgoingConnectionMap) {
35 for (const [module, connections] of outgoingConnectionMap) {
36 if (
37 connections.some(
38 (c) =>
39 c.dependency instanceof HarmonyImportDependency &&
40 c.isTargetActive(undefined)
41 ) &&
42 module
43 ) {
44 g(module);
45 }
46 }
47 }
48 }
49 })(module);
50 return set;
51};
52
53module.exports.getOutgoingAsyncModules = getOutgoingAsyncModules;

Callers 4

getLazySourceMethod · 0.85
importStatementMethod · 0.85

Calls 6

isAsyncMethod · 0.80
isTargetActiveMethod · 0.80
gFunction · 0.50
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected