MCPcopy
hub / github.com/vuejs/vuex / checkSize

Function checkSize

scripts/build.js:35–47  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

33}
34
35function checkSize(file) {
36 const f = fs.readFileSync(file)
37 const minSize = (f.length / 1024).toFixed(2) + 'kb'
38 const gzipped = gzipSync(f)
39 const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
40 const compressed = compress(f)
41 const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
42 console.log(
43 `${chalk.gray(
44 chalk.bold(file)
45 )} size:${minSize} / gzip:${gzippedSize} / brotli:${compressedSize}`
46 )
47}
48
49run()

Callers 1

checkAllSizesFunction · 0.85

Calls 1

logMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…