MCPcopy
hub / github.com/webpack/webpack / chunkHasJs

Function chunkHasJs

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

Source from the content-addressed store, hash-verified

177 * @returns {boolean} true, when a JS file is needed for this chunk
178 */
179const chunkHasJs = (chunk, chunkGraph) => {
180 let innerCache = chunkHasJsCache.get(chunkGraph);
181 if (innerCache === undefined) {
182 innerCache = new WeakMap();
183 chunkHasJsCache.set(chunkGraph, innerCache);
184 }
185
186 const cachedResult = innerCache.get(chunk);
187 if (cachedResult !== undefined) {
188 return cachedResult;
189 }
190
191 const result = _chunkHasJs(chunk, chunkGraph);
192 innerCache.set(chunk, result);
193 return result;
194};
195
196/**
197 * Chunk has runtime or js.

Callers 2

chunkHasRuntimeOrJsFunction · 0.70
applyMethod · 0.70

Calls 3

_chunkHasJsFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected