MCPcopy Index your code
hub / github.com/GoogleChromeLabs/size-plugin

github.com/GoogleChromeLabs/size-plugin @3.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.0.0 ↗ · + Follow
24 symbols 60 edges 11 files 1 documented · 4% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Core symbols most depended-on inside this repo

compile
called by 7
test/_helpers.js
toMap
called by 2
src/util.js
reverseTemplate
called by 2
src/index.js
stripHash
called by 2
src/index.js
readFromDisk
called by 2
src/index.js
getCompressedSize
called by 2
src/index.js
toFileMap
called by 1
src/util.js
writeToDisk
called by 1
src/index.js

Shape

Method 13
Function 9
Class 2

Languages

TypeScript100%

Modules by API surface

src/index.js15 symbols
src/util.js3 symbols
test/index.test.js2 symbols
test/_helpers.js2 symbols
src/publish-size.js2 symbols

For agents

$ claude mcp add size-plugin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact