MCPcopy
hub / github.com/Blazity/next-enterprise / getScriptSizes

Function getScriptSizes

report-bundle-size.js:82–95  ·  view source on GitHub ↗
(scriptPaths)

Source from the content-addressed store, hash-verified

80
81// given an array of scripts, return the total of their combined file sizes
82function getScriptSizes(scriptPaths) {
83 const res = scriptPaths.reduce(
84 (acc, scriptPath) => {
85 const [rawSize, gzipSize] = getScriptSize(scriptPath)
86 acc.raw += rawSize
87 acc.gzip += gzipSize
88
89 return acc
90 },
91 { raw: 0, gzip: 0 }
92 )
93
94 return res
95}
96
97// given an individual path to a script, return its file size
98function getScriptSize(scriptPath) {

Callers 1

Calls 1

getScriptSizeFunction · 0.85

Tested by

no test coverage detected