mirror of https://github.com/webpack/webpack.git
Adds stats presets support to the CLI
the CLI wasn't processing stats presets and was throwing ```sh webpack/bin/webpack.js:63 var outputOptions = Object.create(options.stats || firstOptions.stats || {}); ^ TypeError: Object prototype may only be an Object or null ``` first PR here and couldn't find a contributor guide, so let me know if you need me to fix/add something =)
This commit is contained in:
parent
c7d71fba89
commit
79c5d18d5d
|
@ -135,6 +135,11 @@ function processOptions(options) {
|
||||||
|
|
||||||
var firstOptions = Array.isArray(options) ? options[0] : options;
|
var firstOptions = Array.isArray(options) ? options[0] : options;
|
||||||
|
|
||||||
|
if(typeof options.stats === "boolean" || typeof options.stats === "string") {
|
||||||
|
var statsPresetToOptions = require("../lib/Stats.js").presetToOptions;
|
||||||
|
options.stats = statsPresetToOptions(options.stats);
|
||||||
|
}
|
||||||
|
|
||||||
var outputOptions = Object.create(options.stats || firstOptions.stats || {});
|
var outputOptions = Object.create(options.stats || firstOptions.stats || {});
|
||||||
if(typeof outputOptions.context === "undefined")
|
if(typeof outputOptions.context === "undefined")
|
||||||
outputOptions.context = firstOptions.context;
|
outputOptions.context = firstOptions.context;
|
||||||
|
|
Loading…
Reference in New Issue