MCPcopy
hub / github.com/webpack/webpack / getSize

Method getSize

lib/html/HtmlGenerator.js:232–237  ·  view source on GitHub ↗

* Returns the estimated size for the requested source type. * @param {NormalModule} module the module * @param {SourceType=} type source type * @returns {number} estimate size of the module

(module, type)

Source from the content-addressed store, hash-verified

230 * @returns {number} estimate size of the module
231 */
232 getSize(module, type) {
233 const originalSource = module.originalSource();
234 if (!originalSource) return 0;
235 if (type === HTML_TYPE) return originalSource.size();
236 return originalSource.size() + 10;
237 }
238
239 /**
240 * Processes the provided module.

Callers

nothing calls this directly

Calls 2

originalSourceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected