MCPcopy
hub / github.com/webpack/webpack / walk

Function walk

lib/dependencies/HtmlEntryDependency.js:171–190  ·  view source on GitHub ↗
(/** @type {import("../ChunkGroup")} */ group)

Source from the content-addressed store, hash-verified

169 /** @type {Set<import("../ChunkGroup")>} */
170 const visitedGroups = new Set();
171 const walk = (/** @type {import("../ChunkGroup")} */ group) => {
172 if (visitedGroups.has(group)) return;
173 visitedGroups.add(group);
174 for (const parent of group.parentsIterable) {
175 if (
176 typeof (/** @type {Entrypoint} */ (parent).getEntrypointChunk) ===
177 "function"
178 ) {
179 const parentEntry =
180 /** @type {Entrypoint} */
181 (parent).getEntrypointChunk();
182 if (parentEntry) chunksLoadedByAncestorTags.add(parentEntry);
183 const parentRuntime =
184 /** @type {Entrypoint} */
185 (parent).getRuntimeChunk();
186 if (parentRuntime) chunksLoadedByAncestorTags.add(parentRuntime);
187 }
188 walk(parent);
189 }
190 };
191 walk(entrypoint);
192
193 /** @type {Chunk[]} */

Callers 1

Calls 4

getEntrypointChunkMethod · 0.80
getRuntimeChunkMethod · 0.80
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected