JavaScript Apache-2.0

size-plugin

Track compressed Webpack asset sizes over time.

G

GoogleChromeLabs

Dernière activité 15 juin 2026
GoogleChromeLabs/size-plugin

1,7 k

étoiles

39

forks

38

issues ouvertes

bundlesizeperformance-budgetwebpackwebpack-assetswebpack-plugin

Ce README est souvent en anglais.

size-plugin npm

Prints the gzipped sizes of your webpack assets and the changes since the last build.

size-plugin

🙋 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

new SizePlugin(options)

Parameters

  • options Object
    • options.pattern string? minimatch pattern of files to track
    • options.exclude string? minimatch pattern of files NOT to track
    • options.filename string? file name to save filesizes to disk
    • options.publish boolean? option to publish filesizes to size-plugin-store
    • options.writeFile boolean? option to save filesizes to disk
    • options.stripHash function? custom function to remove/normalize hashed filenames for comparison

Item

Properties

  • name string Filename of the item
  • sizeBefore number Previous size, in kilobytes
  • size number Current size, in kilobytes
  • sizeText string Formatted current size
  • delta number Difference from previous size, in kilobytes
  • deltaText string Formatted size delta
  • msg string Full item's default message
  • color string The item's default CLI color

Data

Properties

  • sizes Array<Item> List of file size items
  • output string Current buffered output

License

Apache 2.0

This is not an official Google product.

Projets similaires

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap

JavaScriptanalyzebundlechart
Wwebpack
12,7 k étoiles514

⏱ See how fast (or not) your plugins and loaders are, so you can optimise your builds

JavaScriptmeasurepluginspeed
Sstephencookdev
2,4 k étoiles79

Keep your bundle size in check

JavaScript
Ssiddharthkp
4,5 k étoiles176