MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / print

Method print

lib/models/asset-size-printer.js:13–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 2

runMethod · 0.80

Calls 2

makeAssetSizesObjectMethod · 0.95
thenMethod · 0.45

Tested by

no test coverage detected