(file)
| 33 | } |
| 34 | |
| 35 | function 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 | |
| 49 | run() |
no test coverage detected
searching dependent graphs…