-
-
Notifications
You must be signed in to change notification settings - Fork 488
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Feature Request: Analyze gzipped bundles #377
Comments
Thank you for opening this separate issue, it is now much clearer what is being asked! If we'd want to support this, it might be enough to spot that file ends in webpack-bundle-analyzer/src/parseUtils.js Lines 10 to 11 in b618f65
to decompress the |
@valscion, I'd like to help but I'm not sure if my local fork is setup right because nothing I change(console logs, file writes) seem to reflect in the webpack build. Steps:
|
Hmm, I'm hazy on how |
I played around with this and was able to get content from the compressed file by doing:
Config which I kept was:
However, there is still a blank page for the above config. Reason being that when stats.toJSON() call tries to map chunks at stats/DefaultStatsFactoryPlugin.js#L260, it sees that But, there is a way to fix this by keeping output filename and compressed filename same, like:
This way webpack can map the chunks to compressed file and so can BundlerAnalyzer. And all stats are generated correctly. @valscion let me know if it makes sense, I can raise a PR for this. PS: There is an issue logged for this in compression-plugin webpack-contrib/compression-webpack-plugin#49 |
@xitter, great stuff! were you able to test it out with Brotli compression as well or that would be a different feature request? |
Brotli is a different feature request :) |
Sorry, don't have time to reply thoroughly to your comment yet, @xitter — sounds like you have made some progress and a PR could be useful |
@RedVelocity @valscion Brotli also worked well as zlib supports it, PR on the way. Config for brotli:
|
Made a PR(#379), please have a look. |
Was there ever a resolution to this? I'm currently in a situation where we use |
For the time being I've just had to run a separate build and pass in a "isStatsBuild" parameter to webpack to omit the compression. It works - not ideal, though. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Issue description
webpack-bundle-analyzer currently displays a blank page when a webpack build uses compression-webpack-plugin to compress bundles.
Technical info
Using the following workaround. This skips compression when webpack build command is used with 'analyze' environment variable.
Debug info
How do you use this module? As CLI utility or as plugin?
-Both
If CLI, what command was used? (e.g.
webpack-bundle-analyzer -O path/to/stats.json
)If plugin, what options were provided? (e.g.
new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)new BundleAnalyzerPlugin()
What other Webpack plugins were used?
clean-webpack-plugin: ^3.0.0 => 3.0.0
compression-webpack-plugin: ^4.0.1 => 4.0.1
html-webpack-plugin: ^4.3.0 => 4.3.0
optimize-css-assets-webpack-plugin: ^5.0.3 => 5.0.3
webpack: ^4.44.1 => 4.44.1
webpack-bundle-analyzer: ^3.8.0 => 3.8.0
webpack-cli: ^3.3.12 => 3.3.12
webpack-dev-server: ^3.11.0 => 3.11.0
webpack-merge: ^5.1.1 => 5.1.1
The text was updated successfully, but these errors were encountered: