Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add describe for getting gzip describe in total #496

Open
hasot opened this issue Sep 26, 2023 · 0 comments
Open

Add describe for getting gzip describe in total #496

hasot opened this issue Sep 26, 2023 · 0 comments

Comments

@hasot
Copy link

hasot commented Sep 26, 2023

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
      
    })
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant