webpack-bundle-analyzer
                                
                                 webpack-bundle-analyzer copied to clipboard
                                
                                    webpack-bundle-analyzer copied to clipboard
                            
                            
                            
                        Add support for reading from STDIN rather than a file
Issue description
The pattern:
webpack --profile --json > stats.json
webpack-bundle-analyzer bundle/output/path/stats.json
is a little un-*nix.
What would be nicer would be something like
webpack --profile --json | webpack-bundle-analyzer -
When I have some time, I'd be happy to create a PR for this.
Hi there! Thanks for the feature suggestion ☺️
The problem is that we also need the bundled contents from the filesystem. Otherwise we'd only be able to visualize the stat size, which isn't really satisfying.
Thank you for offering to create this kind of PR, but I think it might be out of scope of this library. What do you think, @th0r?
Well, I won't mind a PR introducing this feature but with a note in the docs that "in this case you won't see parsed and gzipped sizes".
@dancrumb You can use the <() operator right now if your shell supports it:
webpack-bundle-analyzer <(webpack --profile --json)
It's not completely satisfying (as predicted by @th0r and @valscion). Here is the message:
Error parsing bundle asset "/dev/fd/main.cc2aacef761dbe6fd147.bundle.js": no such file
No bundles were parsed. Analyzer will show only original module sizes from stats file.
 
                                    
                                    
                                    
                                
Probably time to close this, right?
Yeah you can close this if you feel like it 😌 we still don't support reading from STDIN but we're not doing this feature ourselves, either.