Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GoogleChromeLabs/size-plugin
Track compressed Webpack asset sizes over time.
https://github.com/GoogleChromeLabs/size-plugin
bundlesize performance-budget webpack webpack-assets webpack-plugin
Last synced: 3 months ago
JSON representation
Track compressed Webpack asset sizes over time.
- Host: GitHub
- URL: https://github.com/GoogleChromeLabs/size-plugin
- Owner: GoogleChromeLabs
- License: apache-2.0
- Created: 2018-08-24T17:48:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T07:23:59.000Z (4 months ago)
- Last Synced: 2024-10-10T17:42:36.767Z (3 months ago)
- Topics: bundlesize, performance-budget, webpack, webpack-assets, webpack-plugin
- Language: JavaScript
- Homepage: https://npm.im/size-plugin
- Size: 2.57 MB
- Stars: 1,672
- Watchers: 21
- Forks: 41
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - GoogleChromeLabs/size-plugin - Track compressed Webpack asset sizes over time. (JavaScript)
- awesome-github-star - size-plugin
- awesome-list - size-plugin
- awesome-bundle-size - size-plugin - Track compressed Webpack asset sizes over time. (Tools to analyze bundle size / Webpack)
README
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](https://github.com/luwes/rollup-plugin-size) port.
## Installation
Install `size-plugin` as a development dependency using npm:
```sh
npm i -D size-plugin
```* * *
## Usage
Add an instance of the plugin to your webpack configuration:
```diff
// webpack.config.js
+ const SizePlugin = require('size-plugin');module.exports = {
plugins: [
+ new SizePlugin()
]
}
```* * *
## Options
#### Table of Contents
- [SizePlugin](#sizeplugin)
- [Parameters](#parameters)
- [Item](#item)
- [Properties](#properties)
- [Data](#data)
- [Properties](#properties-1)### SizePlugin
`new SizePlugin(options)`
#### Parameters
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `options.pattern` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** minimatch pattern of files to track
- `options.exclude` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** minimatch pattern of files NOT to track
- `options.filename` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** file name to save filesizes to disk
- `options.publish` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** option to publish filesizes to size-plugin-store
- `options.writeFile` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** option to save filesizes to disk
- `options.stripHash` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** custom function to remove/normalize hashed filenames for comparison### Item
#### Properties
- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Filename of the item
- `sizeBefore` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Previous size, in kilobytes
- `size` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Current size, in kilobytes
- `sizeText` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Formatted current size
- `delta` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Difference from previous size, in kilobytes
- `deltaText` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Formatted size delta
- `msg` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Full item's default message
- `color` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The item's default CLI color### Data
#### Properties
- `sizes` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Item](#item)>** List of file size items
- `output` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Current buffered output## License
[Apache 2.0](LICENSE)
This is not an official Google product.