Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a21684a

Browse files
committed
feat(fusuma): improve output log
1 parent 848acbb commit a21684a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/fusuma/src/webpack/outputBuildInfo.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const chalk = require('chalk');
44
const prettyBytes = require('pretty-bytes');
55

66
function outputBuildInfo(res) {
7+
let gzFilesNum = 0;
78
let totalSize = 0;
89
let maxStringSize = 0;
910

@@ -30,6 +31,10 @@ function outputBuildInfo(res) {
3031
let filename = name;
3132
const fileSize = chalk.greenBright(prettyBytes(size));
3233

34+
if (name.includes('.gz')) {
35+
gzFilesNum++;
36+
}
37+
3338
if (name.includes('.js')) {
3439
if (assets.some(({ name }) => name === `${filename}.gz`) || name.includes('.LICENSE')) {
3540
filename = chalk.gray(name);
@@ -52,7 +57,10 @@ function outputBuildInfo(res) {
5257
});
5358

5459
console.log();
55-
console.log('Total:', chalk.greenBright(prettyBytes(totalSize)));
60+
console.log(
61+
`Total ${assets.length} files (gzip: ${gzFilesNum}) -`,
62+
chalk.greenBright(prettyBytes(totalSize))
63+
);
5664
}
5765

5866
module.exports = outputBuildInfo;

0 commit comments

Comments
 (0)