size-plugin
size-plugin copied to clipboard
Track compressed Webpack asset sizes over time.
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.
Installation
Install size-plugin as a development dependency using npm:
npm i -D size-plugin
Usage
Add an instance of the plugin to your webpack configuration:
// webpack.config.js
+ const SizePlugin = require('size-plugin');
module.exports = {
plugins: [
+ new SizePlugin()
]
}
Options
Table of Contents
- SizePlugin
- Parameters
- Item
- Properties
- Data
- Properties
SizePlugin
new SizePlugin(options)
Parameters
optionsObjectoptions.patternstring? minimatch pattern of files to trackoptions.excludestring? minimatch pattern of files NOT to trackoptions.filenamestring? file name to save filesizes to diskoptions.publishboolean? option to publish filesizes to size-plugin-storeoptions.writeFileboolean? option to save filesizes to diskoptions.stripHashfunction? custom function to remove/normalize hashed filenames for comparison
Item
Properties
namestring Filename of the itemsizeBeforenumber Previous size, in kilobytessizenumber Current size, in kilobytessizeTextstring Formatted current sizedeltanumber Difference from previous size, in kilobytesdeltaTextstring Formatted size deltamsgstring Full item's default messagecolorstring The item's default CLI color
Data
Properties
License
Apache 2.0
This is not an official Google product.