webpack-bundle-analyzer icon indicating copy to clipboard operation
webpack-bundle-analyzer copied to clipboard

Send console output to STDERR?

Open inversion opened this issue 6 years ago • 2 comments

The plugin appears to send all its logs to STDOUT rather than STDERR (ie. as it would using console.error). This breaks webpack --json > stats.json. Is there any support for changing the log messages to STDERR?

Technical info

  • Webpack Bundle Analyzer version: 3.0.3
  • Webpack version: 4.28.0
  • Node.js version: 10
  • OS: OSX

Debug info

How do you use this module? As CLI utility or as plugin? As a plugin

If CLI, what command was used? (e.g. webpack-bundle-analyzer -O path/to/stats.json)

If plugin, what options were provided? (e.g. new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true }))

What other Webpack plugins were used? None

inversion avatar Dec 20 '18 16:12 inversion

Ah yes, I think I once tried to move all to stdout but I never completed my work.

What do you think, @th0r? Should we move all debug and warning/error logs to STDERR so that piping commands works in *nix?

valscion avatar Dec 20 '18 17:12 valscion

I don't think using console.error for all types of messages is a good solution here. Can we understand somehow that webpack is being run in --json mode? What does other plugins do in this case?

th0r avatar Apr 10 '19 19:04 th0r