MCPcopy
hub / github.com/webpack/webpack / chunkHasRuntimeOrJs

Function chunkHasRuntimeOrJs

lib/javascript/JavascriptModulesPlugin.js:202–222  ·  view source on GitHub ↗
(chunk, chunkGraph)

Source from the content-addressed store, hash-verified

200 * @returns {boolean} true, when a JS file is needed for this chunk
201 */
202const chunkHasRuntimeOrJs = (chunk, chunkGraph) => {
203 if (chunkHasJs(chunk, chunkGraph)) {
204 return true;
205 }
206
207 if (
208 chunkGraph.getChunkModulesIterableBySourceType(
209 chunk,
210 WEBPACK_MODULE_TYPE_RUNTIME
211 )
212 ) {
213 for (const chunkGroup of chunk.groupsIterable) {
214 for (const c of chunkGroup.chunks) {
215 if (chunkHasJs(c, chunkGraph)) return true;
216 }
217 }
218 return false;
219 }
220
221 return false;
222};
223
224/**
225 * Print generated code for stack.

Callers 1

applyMethod · 0.85

Calls 2

chunkHasJsFunction · 0.70

Tested by

no test coverage detected