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:
npm i -D size-pluginAdd an instance of the plugin to your webpack configuration:
// webpack.config.js
+ const SizePlugin = require('size-plugin');
module.exports = {
plugins: [
+ new SizePlugin()
]
}new SizePlugin(options)
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
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
This is not an official Google product.
