support webpack@5
See original GitHub issueIssue description
…
Technical info
- Webpack Bundle Analyzer version: latest
- Webpack version: next (5)
- Node.js version: 10.13.0
- npm/yarn version: npm 6.13.4
- OS: Linux Ubuntu
Debug info
Support webpack@5 (will be great have CI and fix test to ensure all works as expected)
Additional comment by @valscion in https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/327#issuecomment-729614325:
This one for example has been open almost a year, and the webpack v5 stable release was over a month ago.
Do note that webpack-bundle-analyzer
does work with webpack version 5. There is some combination of options which breaks, but not all of webpack 5.
We even test that this package works with webpack v5: https://github.com/webpack-contrib/webpack-bundle-analyzer/tree/master/test/webpack-versions/5.4.0
So this is only an edge case that is broken, not the entire support for webpack 5.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:17 (12 by maintainers)
Top Results From Across the Web
To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. ... since latest version might only support webpack 5...
Read more >facebook/create-react-app - Webpack 5 support overview
Overview of tasks needed for updating CRA to Webpack 5 - Some of the work will support both Webpack 4 + 5 but...
Read more >Webpack 5 Adoption - Next.js
Improved Long Term Caching of Assets: Deterministic code output that is less likely to change between builds; Improved Tree Shaking; Support for assets...
Read more >Webpack - npm
Webpack supports ES2015+, CommonJS and AMD modules out of the box. It performs clever static analysis on the AST of your code. It...
Read more >Upgrading Webpack 4 → 5 | Square Corner Blog
We upgraded to v3.0.0 for Webpack 5 support. - const ManifestPlugin = require('webpack-manifest-plugin') + const { WebpackManifestPlugin } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After upgrading to
webpack@^5.0.0-beta.22
,webpack-bundle-analyzer
just shows a singlemain.js
, while other packages such aswebpack-visualizer
are able to display my files correctly. The content ofstats.json
looks normal.Interestingly, after I added back Webpack 4 with
yarn add webpack4@npm:webpack@latest
, usingwebpack4
to generatestats.json
produces the same issue of a singlemain.js
. If I completely remove Webpack 5, thenwebpack-bundle-analyzer
works again.Any ideas on how to build using Webpack 5 normally, but use Webpack 4 just for
webpack-bundle-analyzer
?webpack has a different output AST so the parser need to be adjusted. It also gets a little bit more challenging as more variations are possible:
Arrow functions may also be normal functions when
output.ecmaVersion: 5
.Arrays might be objects too, as with webpack 4.
There might also be one entry module inlined into the runtime code, which is very difficult to identify in production mode.