Socket
Book a DemoInstallSign in
Socket

chunkalyse

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chunkalyse

🍰 Summarise webpack stats output file

latest
Source
npmnpm
Version
0.5.8
Version published
Maintainers
1
Created
Source

chunkalyse

🍰 Summarise webpack entries from stats output file

Analyzes Webpack bundle size

This utility uses Webpack's generated stats file.

webpack --profile --json > stats.json

Is analyses chunks and modules according to the structure output from your Webpack version and configuration.

Supports:

  • βœ”οΈŽ Webpack stats πŸ“¦
  • βœ”οΈŽ multiple entries πŸ‘―
  • βœ”οΈŽ multiple configurations β›“
  • βœ”οΈŽ loaders ⏳
  • βœ”οΈŽ CLI output formats πŸ–¨
    • human (default, see below)
    • json

CLI

Pipe stats

webpack --config webpack.config.js --profile --json | npx chunkalyse

Pass file route

webpack --config webpack.config.js --profile --json > stats.json
npx chunkalyse stats.json

Install globally for continues use

npm i -g chunkalyse
webpack --config webpack.config.js --profile --json | chunkalyse

Output formats (examples)

View in CLI, descending in size
$ chunkalyse stats.json

main (331.2 kB)
 β€’ self: 243.8 kB (74%)
 β€’ core-js: 38.8 kB (12%)
 β€’ prop-types: 26.5 kB (8%)
 ...
Write JSON to a file
$ chunkalyse stats.json --format json > chunkalised.json

Module delivers object with named entries

const chunkalyse = require('chunkalyse');
const stats = require('./stats.json');

chunkalyse(stats); // Named summaries (one for each entry point)

{
  main: {
    size: 331215,
    modules: {
      'core-js': {
        size: 38776,
        percent: 12
      },
      self: {
        size: 243771,
        percent: 74
      },
      'style-loader': {
        size: 12465,
        percent: 4
      },
      ...
    }
  }
}

Multiple entries or multiple configurations example

{
  moduleA: { size: 3461, modules: { ... } },
  moduleB: { size: 2533, modules: { ... } },
  moduleC: { size: 3574, modules: { ... } }
}

Thanks

This project uses stats from other projects for research and testing purposes:

Keywords

webpack

FAQs

Package last updated on 21 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts