Tracks your Webpack asset sizes over time.
npm install size-plugin
Prints the gzipped sizes of your webpack assets and the changes since the last build.

> 🙋 Using Rollup? Check out the rollup-plugin-size port.
Install size-plugin as a development dependency using npm:
``sh`
npm i -D size-plugin
*
Add an instance of the plugin to your webpack configuration:
`diff
// webpack.config.js
+ const SizePlugin = require('size-plugin');
module.exports = {
plugins: [
+ new SizePlugin()
]
}
`
*
#### Table of Contents
- SizePlugin
- Parameters
- Item
- Properties
- Data
- Properties
new SizePlugin(options)
#### Parameters
- options Object options.pattern
- string? minimatch pattern of files to trackoptions.exclude
- string? minimatch pattern of files NOT to trackoptions.filename
- string? file name to save filesizes to diskoptions.publish
- boolean? option to publish filesizes to size-plugin-storeoptions.writeFile
- boolean? option to save filesizes to diskoptions.stripHash
- function? custom function to remove/normalize hashed filenames for comparison
#### Properties
- name string Filename of the itemsizeBefore
- number Previous size, in kilobytessize
- number Current size, in kilobytessizeText
- string Formatted current sizedelta
- number Difference from previous size, in kilobytesdeltaText
- string Formatted size deltamsg
- string Full item's default messagecolor
- string The item's default CLI color
#### Properties
- sizes Array<Item> List of file size itemsoutput` string Current buffered output
-
This is not an official Google product.