()
| 11 | } |
| 12 | |
| 13 | print() { |
| 14 | const { filesize } = require('filesize'); |
| 15 | let ui = this.ui; |
| 16 | |
| 17 | return this.makeAssetSizesObject().then((files) => { |
| 18 | if (files.length !== 0) { |
| 19 | ui.writeLine(chalk.green('File sizes:')); |
| 20 | return files.forEach((file) => { |
| 21 | let sizeOutput = filesize(file.size); |
| 22 | if (file.showGzipped) { |
| 23 | sizeOutput += ` (${filesize(file.gzipSize)} gzipped)`; |
| 24 | } |
| 25 | |
| 26 | ui.writeLine(chalk.blue(` - ${file.name}: `) + sizeOutput); |
| 27 | }); |
| 28 | } else { |
| 29 | ui.writeLine(chalk.red(`No asset files found in the path provided: ${this.outputPath}`)); |
| 30 | } |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | printJSON() { |
| 35 | let ui = this.ui; |
no test coverage detected