A webpack plugin that tracks and displays the gzipped sizes of your assets over time, showing deltas from the previous build. Current stable version is 3.0.0 (2021). Released as needed; maintained by Google Chrome Labs. Key differentiators: simple setup, built-in compression options (gzip, brotli, none), TypeScript types, and automatic file size persistence. Compare to webpack-bundle-analyzer which visualizes composition, or bundlesize which enforces thresholds.
npm install size-pluginVerified import paths — ran on the pinned version, not inferred.
Adds the size-plugin to measure and display gzipped sizes of JS assets in webpack output.
Update Node.js to 10+ and webpack to 4+.
Rename option to 'publishSizes'.
Keep the file in your project root or configure a custom filename via 'options.filename'.
Review the output and adjust any parsing logic.
Set 'writeFile: true' (default) or provide a custom 'filename'.
Run 'npm install -D size-plugin' or 'yarn add --dev size-plugin'.
Use 'const SizePlugin = require('size-plugin');'.Ensure 'new SizePlugin(options)' is added to the plugins array and webpack version is >=4.
Set compression to either 'gzip', 'brotli', or 'none'.