Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork503
-
Rather than adding the plugin twice with e.g.: [newBundleAnalyzerPlugin({analyzerMode:'static',openAnalyzer:false,reportFilename:'webpack-report/index.html'),}),newBundleAnalyzerPlugin({analyzerMode:'json',openAnalyzer:false,reportFilename:'webpack-report/index.json'),}),] it would be nice to be able to generate JSON and HTML in one go, e.g.: [newBundleAnalyzerPlugin({analyzerMode:"static",openAnalyzer:false,reportOutput:[{type:"json",fileName:"webpack-report/index.json"},{type:"html",fileName:"webpack-report/index.html"},],}),]; |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 15 comments
-
By the way, great work on this plugin. I don't have time right now to contribute this myself, but it would be a valuable addition to us and I just wanted to write the idea down somewhere. 😄 |
BetaWas this translation helpful?Give feedback.
All reactions
-
/cc@Gongreg |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hey, I think it makes sense, but we should get@valscion opinion on it :) |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks for the idea! I'm not sure if this works out nicely with all the possible options configurations — it looks like we could end up with configuration that is "invalid" and we would have to write quite a lot of error handling code to deal with this situation. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I believe this is possible already. Here is my example setup: This produces at the same time |
BetaWas this translation helpful?Give feedback.
All reactions
-
@
No, because stats.json is from webpack, report of webpuck-bundle-analyzer is different. You can see at json html and compare it with stats.json - they are different, webpack bundle analyzer report contains information only about chunks |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I think it is important feature.
The issue is that I want to have html reports, but I also need reports in json format to be able to compare reports. The expected result is to have to files in build directory: Maybe one of the ways to make it more easy is to not add report-json inline in html (window.chartData), but include it on html page using <script> where src is 'report.json' that is in the same folder. With this changes in static and server modes we always will have json to analyze |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmm yeah, I think adding support for What do you think,@th0r? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Also regarding this:
I don't think we need to do that. It would make the handling of report files more difficult as then the report would not be self-contained in a single HTML file anymore, like it now is. At any rate, we could discuss this change as its own change request, outside of the scope of supporting |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Sorry, I don't have a lot of time currently, but as a workaround, you can also generate your own html file: Published webpack-bundle-analyzer has a file called: That file tries to read |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
@valscion@Gongreg thanks a lot! |
BetaWas this translation helpful?Give feedback.
All reactions
-
Well, I think we can do that, but it will require a change to |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Do note that you are relying on internal logic and this logic can break even in patch releases. I'm glad that it works for you, though
Yeah, this does indeed sound like it. So this isn't a trivial update in the end. It would require quite a lot of effort, so don't hold your breath 😅 |
BetaWas this translation helpful?Give feedback.
All reactions
-
@valscion Submitted a PR with a backwards-compatible implementation:#442 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Really looking forward to this! For now it seems we either have to resort to adding the plugin twice, or disabling it to generate the stats file and then using the CLI. |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #375 on February 23, 2023 09:16.