Class that handles all reporting, logging and compilation progress handling.
• new Reporter(config?
)
Create new instance of Reporter. If Reporter is running as a non-worker, it will start outputting to terminal.
Name | Type | Description |
---|---|---|
config |
ReporterConfig |
Reporter configuration. Defaults to empty object. |
packages/repack/src/Reporter.ts:107
• Readonly
isVerbose: boolean
Whether reporter is running in verbose mode.
packages/repack/src/Reporter.ts:91
• Readonly
isWorker: boolean
Whether reporter is running as a worker.
packages/repack/src/Reporter.ts:89
▸ attachResponse(res
, platform
): void
attach bundle request for later use.
Name | Type |
---|---|
res |
MultipartResponse |
platform |
string |
void
packages/repack/src/Reporter.ts:118
▸ enableFileLogging(filename
): void
Enable reporting to file alongside reporting to terminal.
Name | Type | Description |
---|---|---|
filename |
string |
Absolute path to file to which write logs. |
void
packages/repack/src/Reporter.ts:145
▸ flushFileLogs(): void
Flush all buffered logs to a file provided that file reporting was enabled with enableFileLogging.
void
packages/repack/src/Reporter.ts:153
▸ getLogBuffer(): LogEntry
[]
Get buffered server logs.
LogEntry
[]
Array of server log entries.
packages/repack/src/Reporter.ts:127
▸ getPrettyProgress(rawProgress
, type?
): null
| RegExpExecArray
get done & total from progress message rawProgress examples: "4/8 entries 47/78 dependencies 8/36 modules"
Name | Type | Default value |
---|---|---|
rawProgress |
string |
undefined |
type |
"entries" | "dependencies" | "modules" |
'modules' |
null
| RegExpExecArray
packages/repack/src/Reporter.ts:263
▸ process(logEntry
): void
Process new log entry and report it to terminal and file if file reporting was enabled with enableFileLogging.
Name | Type | Description |
---|---|---|
logEntry |
LogEntry |
Log entry to process & report. |
void
packages/repack/src/Reporter.ts:166
▸ stop(): void
Stop reporting and perform cleanup.
void
packages/repack/src/Reporter.ts:134
▸ Static
colorizeText(logType
, text
): string
Apply ANSI colors to given text.
internal
Name | Type | Description |
---|---|---|
logType |
LogType |
Log type for the text, based on which different colors will be applied. |
text |
string |
Text to apply the color onto. |
string
Text wrapped in ANSI color sequences.
packages/repack/src/Reporter.ts:78
▸ Static
getSymbolForType(logType
): string
Get message symbol for given log type.
internal
Name | Type | Description |
---|---|---|
logType |
LogType |
Log type. |
string
String with the symbol.