Skip to content

Commit d249016

Browse files
committed
Don't emit duplicate module names in stats
1 parent e208f44 commit d249016

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/Stats.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,9 +744,10 @@ class Stats {
744744
if(reason.moduleId !== null) {
745745
colors.normal("[");
746746
colors.normal(reason.moduleId);
747-
colors.normal("] ");
747+
colors.normal("]");
748748
}
749-
if(reason.module) {
749+
if(reason.module && reason.module !== reason.moduleId) {
750+
colors.normal(" ");
750751
colors.magenta(reason.module);
751752
}
752753
if(reason.loc) {
@@ -795,8 +796,12 @@ class Stats {
795796
if(module.id < 10) colors.normal(" ");
796797
colors.normal("[");
797798
colors.normal(module.id);
798-
colors.normal("] ");
799-
colors.bold(module.name || module.identifier);
799+
colors.normal("]");
800+
const name = module.name || module.identifier;
801+
if(name !== module.id) {
802+
colors.normal(" ");
803+
colors.bold(name);
804+
}
800805
processModuleAttributes(module);
801806
newline();
802807
processModuleContent(module, prefix + " ");

0 commit comments

Comments
 (0)