1.0.4 • Published 5 years ago

rollup-plugin-reporter v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

rollup-plugin-reporter

Build Status Maintainability Coverage Status npm version
Custom reports for Rollup

How it works

1. Install npm package via npm npm i rollup-plugin-reporter or via yarn yarn add rollup-plugin-reporter
2. Add plugin call into Rollup config, to plugins sections

// rollup.config.js
import reporter from 'rollup-plugin-reporter';

module.exports = {
    ...,
    plugins: [
        reporter()
    ],
    ...
}

Make custom report

The custom report function will be called with a single data parameter.

// rollup.config.js
import reporter from 'rollup-plugin-reporter';

module.exports = {
    ...,
    plugins: [
        reporter({
            report: data => {
                console.log(`${data.bundle} [${data.size.rendered}]`);
            }
        })
    ],
    ...
}

Structure of data object

{
    // Relative path to bundle file 
    bundle: String,
    
    // Bundle size
    size: {
        original: Number, 
        rendered: Number
    },
    
    // List of modules included in current bundle
    modules: Array<String>
}

Plugin options

{
    // Excluded bundles from report 
    exclude: Array<String>,
    
    // Custom report function
    report: Function 
}

Copyright and license

Code and documentation copyright 2018 Vladimir Belov. Code released under the MIT license.

1.0.4

5 years ago

1.0.3

6 years ago

1.0.21

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago