MCPcopy
hub / github.com/webpack/webpack / getEntryRuntime

Function getEntryRuntime

lib/util/runtime.js:24–55  ·  lib/util/runtime.js::getEntryRuntime
(compilation, name, options)

Source from the content-addressed store, hash-verified

22 * @returns {RuntimeSpec} runtime
23 */
24const getEntryRuntime = (compilation, name, options) => {
25 /** @type {EntryOptions[class="st">"dependOn"]} */
26 let dependOn;
27 /** @type {EntryOptions[class="st">"runtime"]} */
28 let runtime;
29 if (options) {
30 ({ dependOn, runtime } = options);
31 } else {
32 const entry = compilation.entries.get(name);
33 if (!entry) return name;
34 ({ dependOn, runtime } = entry.options);
35 }
36 if (dependOn) {
37 /** @type {RuntimeSpec} */
38 let result;
39 const queue = new Set(dependOn);
40 for (const name of queue) {
41 const dep = compilation.entries.get(name);
42 if (!dep) continue;
43 const { dependOn, runtime } = dep.options;
44 if (dependOn) {
45 for (const name of dependOn) {
46 queue.add(name);
47 }
48 } else {
49 result = mergeRuntimeOwned(result, runtime || name);
50 }
51 }
52 return result || name;
53 }
54 return runtime || name;
55};
56
57/**
58 * Processes the provided runtime.

Callers 7

applyMethod · 0.85
applyMethod · 0.85
visitModulesFunction · 0.85
applyMethod · 0.85
finishEntryModuleMethod · 0.85
finishEntryModuleMethod · 0.85
finishEntryModuleMethod · 0.85

Calls 3

mergeRuntimeOwnedFunction · 0.85
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected