MCPcopy
hub / github.com/webpack/webpack / getModulesSizes

Function getModulesSizes

lib/ChunkGraph.js:191–200  ·  lib/ChunkGraph.js::getModulesSizes
(modules)

Source from the content-addressed store, hash-verified

189 * @returns {SizesOfModules} the sizes of the modules
190 */
191const getModulesSizes = (modules) => {
192 /** @type {SizesOfModules} */
193 const sizes = Object.create(null);
194 for (const module of modules) {
195 for (const type of module.getSourceTypes()) {
196 sizes[type] = (sizes[type] || 0) + module.size(type);
197 }
198 }
199 return sizes;
200};
201
202/**
203 * Checks whether this module hash info is available chunk.

Callers

nothing calls this directly

Calls 3

createMethod · 0.45
getSourceTypesMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected