Skip to content

Commit

Permalink
Fix format webpack messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sebinsua committed Apr 9, 2020
1 parent 1616bfa commit 70019d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ function formatMessage(messageOrMessageMetadata) {
if (typeof messageOrMessageMetadata === 'string') {
message = messageOrMessageMetadata;
} else {
// Clean up file name
moduleName = chalk.inverse(
messageOrMessageMetadata.moduleName.replace(/^(.*) \d+:\d+-\d+$/, '$1')
);
if (messageOrMessageMetadata.moduleName) {
// Clean up file name
moduleName = chalk.inverse(
messageOrMessageMetadata.moduleName.replace(/^(.*) \d+:\d+-\d+$/, '$1')
);
}

message = messageOrMessageMetadata.message;
}
Expand Down

0 comments on commit 70019d7

Please sign in to comment.