size-plugin

Track compressed Webpack asset sizes over time.

Github stars Tracking Chart

? 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.

Main metrics

Overview
Name With OwnerGoogleChromeLabs/size-plugin
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:Apache License 2.0
所有者活动
Created At2018-08-24 17:48:27
Pushed At2025-06-24 05:25:40
Last Commit At2021-08-30 17:13:09
Release Count12
Last Release Name3.0.0 (Posted on )
First Release Name1.0.0 (Posted on )
用户参与
Stargazers Count1.7k
Watchers Count20
Fork Count41
Commits Count53
Has Issues Enabled
Issues Count24
Issue Open Count8
Pull Requests Count9
Pull Requests Open Count19
Pull Requests Close Count11
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private