-
-
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: Allow JSON and HTML output at the same time. #375
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. 😄 |
/cc @Gongreg |
Hey, I think it makes sense, but we should get @valscion opinion on it :) |
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. |
I believe this is possible already. Here is my example setup:
This produces at the same time |
@
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 |
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 |
Hmm yeah, I think adding support for What do you think, @th0r? |
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 |
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 |
@valscion @Gongreg
thanks a lot! |
Well, I think we can do that, but it will require a change to |
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 😅 |
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. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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.:
The text was updated successfully, but these errors were encountered: