diff --git a/bin/webpack.js b/bin/webpack.js index 37125533c52..ea43aed5e63 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -334,7 +334,10 @@ function processOptions(options) { process.exit(1); // eslint-disable-line } if(outputOptions.json) { - process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n"); + var stringify = require('JSONStream').stringify('', '', ''); + stringify.pipe(process.stdout); + stringify.write(stats.toJson(outputOptions)); + stringify.end(); } else if(stats.hash !== lastHash) { lastHash = stats.hash; process.stdout.write(stats.toString(outputOptions) + "\n"); diff --git a/package.json b/package.json index a563fa8263e..ce49682e097 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "dependencies": { + "JSONStream": "^1.3.1", "acorn": "^5.0.0", "acorn-dynamic-import": "^2.0.0", "ajv": "^4.7.0",