()
| 32 | } |
| 33 | |
| 34 | printJSON() { |
| 35 | let ui = this.ui; |
| 36 | return this.makeAssetSizesObject().then((files) => { |
| 37 | if (files.length !== 0) { |
| 38 | let entries = files.map((file) => ({ |
| 39 | name: file.name, |
| 40 | size: file.size, |
| 41 | gzipSize: file.gzipSize, |
| 42 | })); |
| 43 | ui.writeLine(JSON.stringify({ files: entries })); |
| 44 | } else { |
| 45 | ui.writeLine(chalk.red(`No asset files found in the path provided: ${this.outputPath}`)); |
| 46 | } |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | async makeAssetSizesObject() { |
| 51 | let files = this.findFiles(); |
no test coverage detected