Webpack-bundle-analyzer: Generate result into static files

Created on 1 Nov 2016  路  6Comments  路  Source: webpack-contrib/webpack-bundle-analyzer

Instead of starting an HTTP server, is there a way to simply output the generated HTML files (and necessary resources) into static files in a chosen folder?

This would allow us to create simple reports for each build in our CI system.

Thanks for the plugin, it's really cool! :+1:

Most helpful comment

new BundleAnalyzerPlugin({
  analyzerMode: 'static',
  reportFilename: path.resolve('.build/webpack/index.html')
});

Seems to work great for my use case.
Thanks a lot for your quick implementation!

I think we can close this issue now :)

All 6 comments

@th0r Just started looking through the code. Would be happy to give this a shot! Let me know if there's any particular way you'd like me to approach this or if you'd rather not have this feature for some reason.

Thanks! Very excited about this plugin.

Yes, I thought about it but chose http server as it doesn't pollute fs, but I think we should support static reports as well.
The only question is shall we generate a bunch of files or inline all necessary scripts and styles into one huge report.html?
Thoughts?

To be honest I'm pretty ok with having several files.

Usually my workflow is to output reports into subfolder inside a particular folder, and then serving the index.html

e.g.: project_folder/.build/{coverage,eslint}/index.html

Output to a single file is a totally fine option too, I'm just sharing my usual workflow and opinion :)

Generating static files would be super helpful for us too as we are currently generating statistics on every pull request and make them available as a build artifact.

Implemented in v1.4.0: use analyzerMode: 'static' option.

new BundleAnalyzerPlugin({
  analyzerMode: 'static',
  reportFilename: path.resolve('.build/webpack/index.html')
});

Seems to work great for my use case.
Thanks a lot for your quick implementation!

I think we can close this issue now :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanpcmcquen picture ryanpcmcquen  路  5Comments

zbuhler picture zbuhler  路  5Comments

bregenspan picture bregenspan  路  9Comments

mulholio picture mulholio  路  3Comments

s524797336 picture s524797336  路  8Comments