A Rollup plugin to track library bundle sizes and treeshakability with detailed snapshots.
rollup-plugin-size-snapshot is a Rollup plugin that automatically tracks and reports the size of JavaScript bundles, including actual, minified, and gzipped measurements. It helps library developers ensure their packages remain lightweight and treeshakable by analyzing how much code users will actually consume. The plugin stores size data in a snapshot file for easy comparison and regression detection.
JavaScript library developers using Rollup as their bundler, especially those focused on optimizing bundle size and ensuring efficient treeshaking for end-users.
Developers choose this plugin because it provides automated, detailed size insights directly within their Rollup build process, reducing manual effort. Its unique ability to analyze treeshakability with both Rollup and Webpack helps guarantee that libraries don't force unnecessary code on consumers.
Track your library bundles size and its treeshakability with less effort
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Tracks actual, minified, and gzipped bundle sizes, providing a holistic view of parsing and download overhead as highlighted in the README for critical library evaluation.
Analyzes treeshakability with both Rollup and Webpack for es format bundles, a unique feature that helps ensure no dead code is shipped in multi-part libraries.
Supports snapshot matching in CI pipelines with configurable thresholds, automating regression detection to prevent unexpected size increases, as described in the matchSnapshot option.
Easily added to Rollup configurations with minimal setup, and options like printInfo allow customization of terminal logging for streamlined workflows.
Exclusively designed for Rollup, making it incompatible with other bundlers like Webpack or Vite without complex integration, severely limiting its applicability in mixed ecosystems.
The matchSnapshot feature is intended for CI use, and using it locally is unintended and problematic, as admitted in the README referencing issue #33, which can confuse developers during local development.
Treeshakability analysis only works with the es output format, restricting its utility for libraries that output other formats like CommonJS or UMD, reducing its effectiveness for broader use cases.