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
Why is webpack-bundle-analyzer strongly *not* recommended? #48883
Comments
You can find info here: https://gitlab.com/gitlab-org/gitlab-foss/-/issues/33497 About the documentation, I disagree about changes: the goal should be to convey good practices only. |
@geromegrignon thanks for the link, but this is not official, and I don't think a tool should be strongly discouraged for not being "perfectly accurate". If that's the only problem with it, we might as well keep using it. |
This content was shared in the past by Minko Gechev, so while not official content, it means the Angular team shares these thoughts. That's up to you to choose the tool you want, I would have some concerns about bundle inspection by using a tool known as not being 'perfectly accurate' when there is an alternative. |
@geromegrignon is referring to that tweet: https://twitter.com/mgechev/status/1278338744077004801 |
@geromegrignon @JeanMeche to be clear, if it were up to me, I'd be using source-map-explorer (and I did, in previous projects). |
You are free to use webpack-bundle-analyzer. But it’s important to point out that by using a custom webpack configuration you are charting unsupported territory. source-map-explorer has a number of advantages:
Historically, the CLI did some optmizations outside of webpack context which caused the webpack-bundle-analysed to generate reports on not fully optimized bundles. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Describe the problem that you experienced
For a long time, developers have been using webpack-bundle-analyzer to analyze Angular app bundle sizes. Then, at some point (Angular 9?) it came to be that webpack-bundle-analyzer was strongly discouraged by the Angular team, but other than the video below, I cannot find any official Angular documentation about it.
https://www.youtube.com/watch?v=B-lipaiZII8&t=215s
Enter the URL of the topic with the problem
https://angular.io/guide/deployment#inspect-the-bundles
Describe what you were looking for in the documentation
I am looking into a clear explanation on why webpack-bundle-analyzer is strongly discouraged, in favor of source-map-explorer.
Describe the actions that led you to experience the problem
I'm working with a custom framework which still uses webpack-bundle-analyzer in Angular versions 14-15.
On top of that, there are plenty of articles still online on how to use webpack-bundle-analyzer with Angular apps. This causes confusion (assuming there are serious reasons why we shouldn't be using it).
Describe what you want to experience that would fix the problem
The link in the documentation mentioned above should clearly state that webpack-bundle-analyzer is not recommended, and state the reasons why.
Add a screenshot if that helps illustrate the problem
No response
If this problem caused an exception or error, please paste it here
No response
If the problem is browser-specific, please specify the device, OS, browser, and version
No response
Provide any additional information here in as much as detail as you can
No response
The text was updated successfully, but these errors were encountered: