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

Commit d299bc3

Browse files
committed
fix(webpack): format output lines
1 parent 9d56417 commit d299bc3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/fusuma/src/webpack/outputBuildInfo.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ const prettyBytes = require('pretty-bytes');
55

66
function outputBuildInfo(res) {
77
let totalSize = 0;
8+
let maxStringSize = 0;
89

910
const assets = Object.entries(res.compilation.assets).map(([name, asset]) => {
1011
const size = asset.size();
1112

1213
totalSize += size;
1314

15+
if (maxStringSize < name.length) {
16+
maxStringSize = name.length;
17+
}
18+
1419
return {
1520
name,
1621
size,
@@ -43,7 +48,7 @@ function outputBuildInfo(res) {
4348
filename = chalk.magenta(name);
4449
}
4550

46-
console.log(filename, fileSize);
51+
console.log(`${filename} ${' '.repeat(maxStringSize - name.length)}${fileSize}`);
4752
});
4853

4954
console.log();

0 commit comments

Comments
 (0)