Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Build Report Plugin

This will populate context.build with a bunch of data coming from the build.

{
    build: {
        errors: string[];
        warnings: string[];
        // The list of entries used in the build.
        entries ? : {
            filepath: string;
            inputs: Input[],
            name: string;
            outputs: Output[]
            size: number;
            type: string,
        } [];
        // The list of inputs used in the build.
        inputs ? : {
            filepath: string;
            dependencies: Input[];
            dependents: Input[]
            name: string;
            size: number;
            type: string,
        } [];
        // The list of outputs generated by the build.
        outputs ? : {
            filepath: string;
            name: string;
            size: number;
            type: string,
            // Sourcemaps will use Outputs as their Inputs.
            inputs: (Input | Output)[]
        } [];
        start?: number;
        end?: number;
        duration?: number;
        writeDuration?: number;
    };
}

Hooks

buildReport

This hook is called when the build report has been generated.
It is useful to get the current build's dependency graph for instance. Happens during the writeBundle hook.

{
    name: 'my-plugin',
    buildReport(report: BuildReport) {
        // Do something with the data
    }
}