stats.json messed up with outputs from webpackbar
See original GitHub issueFirst of all, thanks so much for this wonderful progress bar.
I was using webpackbar and tried to write a stats.json
file to be used by webpack-bundle-analyzer
.
Here’s my npm script:
webpack --env=production --profile --json > stats.json
However, stats.json contains some output from webpackbar. Here’s how it looks like:
ℹ Compiling Webpack webpackbar 18:06:57
✔ Webpack: Compiled successfully in 3.22s webpackbar 18:07:00
{
"errors": [],
"warnings": [],
"version": "4.29.3",
"hash": "ed64caf72379ba267639",
"time": 3228,
"builtAt": 1549976820840,
"publicPath": "/",
"outputPath": "/Users/shahzaib/my-stuff/serious-projects/testing-shaizei/copy-jetsetter/build",
"assetsByChunkName": {
"main": [
// remaining file is not included for brevity
}
Due to these two lines (in the start), stats.json
is becoming invalid.
Any workaround for this?
<div align="right">This question is available on Nuxt community (#c33)</div>Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
stats.json messed up with outputs from webpackbar · Issue #42
I was using webpackbar and tried to write a stats.json file to be used by ... stats.json messed up with outputs from webpackbar...
Read more >Error reading webpack-stats.json - Stack Overflow
I have made a docker file to try to replicate the environment and I have even pushed the image to docker hub ....
Read more >Build Analysis - SurviveJS
Analyzing build statistics is a good step towards understanding webpack better. ... If you want JSON output from stats , use stats.toJson() ....
Read more >ProgressPlugin - webpack
The ProgressPlugin provides a way to customize how progress is reported during a compilation. Usage. Create an instance of ProgressPlugin and provide one...
Read more >Lessons Learned From a Year of Fighting With Webpack and ...
stats : 'minimal' }. 2. Add WebpackBar to get much less-verbose, friendlier, and more concise output. Note: The first configuration is meant ...
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
When using the
--json
flag viawebpack-cli
thewebpackbar
plugin should not output …… because it makes the JSON output invalid.
Will this issue be worked on in the future or are there any reasons it has not been closed yet? Thanks!
Countless plugins use the
console
API. So I think any output from the terminal is untrustworthy, I don’t recommend usingwhatever --foo --bar > files.json