Skip to content

Add describe for getting gzip describe in total #496

Open
@hasot

Description

@hasot

In Common total hard to understand how I can get gzip total. After couple hours I could understand what for getting gzip size describe I must compress all my files with compression-webpack-plugin. I don't have permission in your repository and can't create PR, but pls add help describe for other people

example from readme which I created but cannot create PR:

In your application, if you want to add gzip size in total, you will need to create gzip files from your project.

For example, you should add minRatio: Infinity in compression-webpack-plugin for get it because default value for minRatio: 0.8

// webpack.config.js
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')

// optionally you can also output compressed/gzipped stats. Requires a version >=1.1.0
const CompressionPlugin = require('compression-webpack-plugin')

module.exports = {
  plugins: [
    ...plugins,
    // not required
      new CompressionPlugin({
          test: /\.(js|css|json)(\?.*)?$/i,
          algorithm: 'gzip',
          minRatio: Infinity,
      }),

    // required
    new BundleAnalyzerPlugin({
      // generate the stats.json file
      generateStatsFile: true
      
    })
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions