MCPcopy
hub / github.com/webpack/webpack / getEntrypointSize

Method getEntrypointSize

lib/performance/SizeLimitsPlugin.js:91–104  ·  view source on GitHub ↗
(entrypoint)

Source from the content-addressed store, hash-verified

89 * @returns {number} the size of the entrypoint
90 */
91 const getEntrypointSize = (entrypoint) => {
92 let size = 0;
93 for (const file of entrypoint.getFiles()) {
94 const asset = compilation.getAsset(file);
95 if (
96 asset &&
97 assetFilter(asset.name, asset.source, asset.info) &&
98 asset.source
99 ) {
100 size += asset.info.size || asset.source.size();
101 }
102 }
103 return size;
104 };
105
106 /** @type {AssetDetails[]} */
107 const assetsOverSizeLimit = [];

Callers

nothing calls this directly

Calls 3

getFilesMethod · 0.80
getAssetMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected