Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-stats-plugin

Package Overview
Dependencies
Maintainers
31
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-stats-plugin

Webpack stats plugin

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
468K
decreased by-5.82%
Maintainers
31
Weekly downloads
 
Created

What is webpack-stats-plugin?

The webpack-stats-plugin is a plugin for Webpack that allows you to generate and customize the stats output of your Webpack build process. This can be useful for analyzing the build performance, understanding the structure of your bundles, and debugging issues.

What are webpack-stats-plugin's main functionalities?

Generate Stats JSON

This feature allows you to generate a JSON file containing detailed statistics about your Webpack build. The `StatsWriterPlugin` is configured to output a `stats.json` file with information about assets, chunks, and modules.

const { StatsWriterPlugin } = require('webpack-stats-plugin');

module.exports = {
  plugins: [
    new StatsWriterPlugin({
      filename: 'stats.json',
      stats: {
        all: false,
        assets: true,
        chunks: true,
        modules: true,
      },
    }),
  ],
};

Custom Stats Output

This feature allows you to customize the output of the stats file. The `transform` function is used to modify the data before it is written to the file. In this example, the output JSON file will contain only the assets and module names.

const { StatsWriterPlugin } = require('webpack-stats-plugin');

module.exports = {
  plugins: [
    new StatsWriterPlugin({
      filename: 'custom-stats.json',
      transform(data, opts) {
        return JSON.stringify({
          assets: data.assetsByChunkName,
          modules: data.modules.map(module => module.name),
        }, null, 2);
      },
    }),
  ],
};

Other packages similar to webpack-stats-plugin

Keywords

FAQs

Package last updated on 18 Dec 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc