(log: AugmentedRollupLog)
| 80 | } |
| 81 | |
| 82 | export function augmentLogMessage(log: AugmentedRollupLog): void { |
| 83 | // Make sure to only augment the log message once |
| 84 | if (!(log.plugin || log.loc) || log[symbolAugmented]) { |
| 85 | return; |
| 86 | } |
| 87 | log[symbolAugmented] = true; |
| 88 | let prefix = ''; |
| 89 | |
| 90 | if (log.plugin) { |
| 91 | prefix += `[plugin ${log.plugin}] `; |
| 92 | } |
| 93 | const id = log.id || log.loc?.file; |
| 94 | if (id) { |
| 95 | const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : ''; |
| 96 | prefix += `${relativeId(id)}${position}: `; |
| 97 | } |
| 98 | const oldMessage = log.message; |
| 99 | log.message = prefix + log.message; |
| 100 | tweakStackMessage(log, oldMessage); |
| 101 | } |
| 102 | |
| 103 | // Error codes should be sorted alphabetically while errors should be sorted by |
| 104 | // error code below |
no test coverage detected
searching dependent graphs…