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. 😄 |
Beta Was this translation helpful? Give feedback.
-
/cc @Gongreg |
Beta Was this translation helpful? Give feedback.
-
Hey, I think it makes sense, but we should get @valscion opinion on it :) |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I believe this is possible already. Here is my example setup:
This produces at the same time |
Beta Was this translation helpful? Give feedback.
-
@
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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Hmm yeah, I think adding support for What do you think, @th0r? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
@valscion @Gongreg
thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
Well, I think we can do that, but it will require a change to |
Beta Was this translation helpful? Give feedback.
-
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 😅 |
Beta Was this translation helpful? Give feedback.
-
@valscion Submitted a PR with a backwards-compatible implementation: #442 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Rather than adding the plugin twice with e.g.:
it would be nice to be able to generate JSON and HTML in one go, e.g.:
Beta Was this translation helpful? Give feedback.
All reactions