MCPcopy
hub / github.com/webpack/webpack / handler

Method handler

lib/optimize/RemoveEmptyChunksPlugin.js:28–40  ·  view source on GitHub ↗
(chunks)

Source from the content-addressed store, hash-verified

26 * @returns {void}
27 */
28 const handler = (chunks) => {
29 const chunkGraph = compilation.chunkGraph;
30 for (const chunk of chunks) {
31 if (
32 chunkGraph.getNumberOfChunkModules(chunk) === 0 &&
33 !chunk.hasRuntime() &&
34 chunkGraph.getNumberOfEntryModules(chunk) === 0
35 ) {
36 compilation.chunkGraph.disconnectChunk(chunk);
37 compilation.chunks.delete(chunk);
38 }
39 }
40 };
41
42 compilation.hooks.optimizeChunks.tap(
43 {

Callers

nothing calls this directly

Calls 5

hasRuntimeMethod · 0.80
disconnectChunkMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected