Awesome
<p align="center"> <h1 align="center"> size-plugin <a href="https://www.npmjs.org/package/size-plugin"><img src="https://img.shields.io/npm/v/size-plugin.svg?style=flat" alt="npm"></a> </h1> </p> <p align="center"> Prints the gzipped sizes of your webpack assets and the changes since the last build. </p> <p align="center"> <img src="https://i.imgur.com/3bWBrJm.png" width="602" alt="size-plugin"> </p>🙋 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
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->Table of Contents
SizePlugin
new SizePlugin(options)
Parameters
options
Objectoptions.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
Item
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
Data
Properties
License
This is not an official Google product.