Feature Request: Allow JSON and HTML output at the same time.
See original GitHub issueRather than adding the plugin twice with e.g.:
[
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
reportFilename: 'webpack-report/index.html'),
}),
new BundleAnalyzerPlugin({
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.:
[
new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
reportOutput: [
{ type: "json", fileName: "webpack-report/index.json" },
{ type: "html", fileName: "webpack-report/index.html" },
],
}),
];
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
in express.js, any way to capture request to both json and html ...
I believe res.format() is the way to do this in Express 3.x and 4.x: res.format({ text: function(){ res.send('hey'); }, html: function(){ ...
Read more >Add feature to allow returning JSON output as a block - Drupal
For my request, I still need to be able to get the data in a standard JSON format. The way that I get...
Read more >Best practices for REST API design - Stack Overflow Blog
REST APIs should accept JSON for request payload and also send responses to JSON. JSON is the standard for transferring data.
Read more >Here are the most popular ways to make an HTTP request in ...
In this article, we are going to look at a few popular ways to make HTTP requests in JavaScript. Ajax Ajax is the...
Read more >Splash HTTP API — Splash 1.0 documentation - Read the Docs
This option is only supported for application/json POST requests. Value could be either a ... Arguments for this endpoint are the same as...
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
Well, I think we can do that, but it will require a change to
reportFilename
option to be able to return different filenames for different report types e.g. allow to make it a function(reportType) => <reportFilename>
(which won’t work for CLI) or an object{<reportType>: <reportFilename>}
. Anyway, options becomes a mess… We definitely need to ship a new major version with completely revised API with pluggable external reporters.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:
webpack-bundle-analyzer/public/viewer.js
That file tries to read
window.chartData
. If you create a HTML file with the json data set to thewindow.chartData
, and include the script file it should render correctly.