MCPcopy
hub / github.com/webpack/webpack / outputCombination

Function outputCombination

lib/javascript/StartupHelpers.js:63–83  ·  view source on GitHub ↗
(chunks, moduleIds, final)

Source from the content-addressed store, hash-verified

61 * @param {boolean=} final true when final, otherwise false
62 */
63 const outputCombination = (chunks, moduleIds, final) => {
64 if (chunks.size === 0) {
65 runtime.push(
66 `${final ? EXPORT_PREFIX : ""}(${moduleIds.map(runModule).join(", ")});`
67 );
68 } else {
69 const fn = runtimeTemplate.returningFunction(
70 moduleIds.map(runModule).join(", ")
71 );
72 runtime.push(
73 `${final && !passive ? EXPORT_PREFIX : ""}${
74 passive
75 ? RuntimeGlobals.onChunksLoaded
76 : RuntimeGlobals.startupEntrypoint
77 }(0, ${JSON.stringify(Array.from(chunks, (c) => c.id))}, ${fn});`
78 );
79 if (final && passive) {
80 runtime.push(`${EXPORT_PREFIX}${RuntimeGlobals.onChunksLoaded}();`);
81 }
82 }
83 };
84
85 /** @type {Chunks | undefined} */
86 let currentChunks;

Callers 1

StartupHelpers.jsFile · 0.85

Calls 2

returningFunctionMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected