Reporter
A plugin type: Listen to events of the build
Reporters receive events as they happen and can output to stdout/stderr, or perform other actions.
import {Reporter} from '@parcel/plugin';
export default new Reporter({
  async report({ event: { type, ... } }) {
    // ...
  }
});¶ Relevant API
ProgressLogEvent parcel/packages/core/types/index.js:1606
type ProgressLogEvent = {|  +type: 'log',  +level: 'progress',  +phase?: string,  +message: string,|}Referenced by:
LogEventDiagnosticLogEvent parcel/packages/core/types/index.js:1617
A log event with a rich diagnostic
type DiagnosticLogEvent = {|  +type: 'log',  +level: 'error' | 'warn' | 'info' | 'verbose',  +diagnostics: Array<Diagnostic>,|}Referenced by:
LogEventTextLogEvent parcel/packages/core/types/index.js:1626
type TextLogEvent = {|  +type: 'log',  +level: 'success',  +message: string,|}Referenced by:
LogEventLogEvent parcel/packages/core/types/index.js:1635
Type
type LogEvent = ProgressLogEvent | DiagnosticLogEvent | TextLogEvent;Referenced by:
ReporterEventBuildStartEvent parcel/packages/core/types/index.js:1641
The build just started.
type BuildStartEvent = {|  +type: 'buildStart',|}Referenced by:
ReporterEventWatchStartEvent parcel/packages/core/types/index.js:1649
The build just started in watch mode.
type WatchStartEvent = {|  +type: 'watchStart',|}Referenced by:
ReporterEventWatchEndEvent parcel/packages/core/types/index.js:1657
The build just ended in watch mode.
type WatchEndEvent = {|  +type: 'watchEnd',|}Referenced by:
ReporterEventResolvingProgressEvent parcel/packages/core/types/index.js:1665
A new Dependency is being resolved.
type ResolvingProgressEvent = {|  +type: 'buildProgress',  +phase: 'resolving',  +dependency: Dependency,|}Referenced by:
BuildProgressEventTransformingProgressEvent parcel/packages/core/types/index.js:1675
A new Asset is being transformed.
type TransformingProgressEvent = {|  +type: 'buildProgress',  +phase: 'transforming',  +filePath: FilePath,|}Referenced by:
BuildProgressEventBundlingProgressEvent parcel/packages/core/types/index.js:1685
The BundleGraph is generated.
type BundlingProgressEvent = {|  +type: 'buildProgress',  +phase: 'bundling',|}Referenced by:
BuildProgressEventPackagingProgressEvent parcel/packages/core/types/index.js:1694
A new Bundle is being packaged.
type PackagingProgressEvent = {|  +type: 'buildProgress',  +phase: 'packaging',  +bundle: NamedBundle,|}Referenced by:
BuildProgressEventOptimizingProgressEvent parcel/packages/core/types/index.js:1704
A new Bundle is being optimized.
type OptimizingProgressEvent = {|  +type: 'buildProgress',  +phase: 'optimizing',  +bundle: NamedBundle,|}Referenced by:
BuildProgressEventBuildProgressEvent parcel/packages/core/types/index.js:1713
Type
type BuildProgressEvent = ResolvingProgressEvent | TransformingProgressEvent | BundlingProgressEvent | PackagingProgressEvent | OptimizingProgressEvent;Referenced by:
ReporterEventBuildSuccessEvent parcel/packages/core/types/index.js:1724
The build was successful.
type BuildSuccessEvent = {|  +type: 'buildSuccess',  +bundleGraph: BundleGraph<PackagedBundle>,  +buildTime: number,  +changedAssets: Map<string, Asset>,  +requestBundle: (bundle: NamedBundle) => Promise<BuildSuccessEvent>,|}Referenced by:
BuildEvent, ReporterEventBuildFailureEvent parcel/packages/core/types/index.js:1736
The build failed.
type BuildFailureEvent = {|  +type: 'buildFailure',  +diagnostics: Array<Diagnostic>,|}Referenced by:
BuildEvent, ReporterEventBuildEvent parcel/packages/core/types/index.js:1744
Type
type BuildEvent = BuildFailureEvent | BuildSuccessEvent;ValidationEvent parcel/packages/core/types/index.js:1750
A new file is being validated.
type ValidationEvent = {|  +type: 'validation',  +filePath: FilePath,|}Referenced by:
ReporterEventReporterEvent parcel/packages/core/types/index.js:1758
Type
type ReporterEvent = LogEvent | BuildStartEvent | BuildProgressEvent | BuildSuccessEvent | BuildFailureEvent | WatchStartEvent | WatchEndEvent | ValidationEvent;Referenced by:
ReporterReporter parcel/packages/core/types/index.js:1771
type Reporter = {|  report({|
    event: ReporterEvent,
    options: PluginOptions,
    logger: PluginLogger,
  |}): Async<void>,|}