Skip to content

Commit

Permalink
feat(fusuma): improve output log
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jan 30, 2021
1 parent 848acbb commit a21684a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/fusuma/src/webpack/outputBuildInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const chalk = require('chalk');
const prettyBytes = require('pretty-bytes');

function outputBuildInfo(res) {
let gzFilesNum = 0;
let totalSize = 0;
let maxStringSize = 0;

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

if (name.includes('.gz')) {
gzFilesNum++;
}

if (name.includes('.js')) {
if (assets.some(({ name }) => name === `${filename}.gz`) || name.includes('.LICENSE')) {
filename = chalk.gray(name);
Expand All @@ -52,7 +57,10 @@ function outputBuildInfo(res) {
});

console.log();
console.log('Total:', chalk.greenBright(prettyBytes(totalSize)));
console.log(
`Total ${assets.length} files (gzip: ${gzFilesNum}) -`,
chalk.greenBright(prettyBytes(totalSize))
);
}

module.exports = outputBuildInfo;

0 comments on commit a21684a

Please sign in to comment.