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-pluginUsage
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
new SizePlugin(options)
Parameters
-
optionsObject-
options.patternstring? minimatch pattern of files to track -
options.excludestring? minimatch pattern of files NOT to track -
options.filenamestring? file name to save filesizes to disk -
options.publishboolean? option to publish filesizes to size-plugin-store -
options.writeFileboolean? option to save filesizes to disk -
options.stripHashfunction? custom function to remove/normalize hashed filenames for comparison
-
Item
Properties
-
namestring Filename of the item -
sizeBeforenumber Previous size, in kilobytes -
sizenumber Current size, in kilobytes -
sizeTextstring Formatted current size -
deltanumber Difference from previous size, in kilobytes -
deltaTextstring Formatted size delta -
msgstring Full item's default message -
colorstring The item's default CLI color
Data
Properties
License
This is not an official Google product.
