diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/webpack/bin/webpack.js | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) |
upgrade dependencies
Diffstat (limited to 'node_modules/webpack/bin/webpack.js')
-rwxr-xr-x | node_modules/webpack/bin/webpack.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/node_modules/webpack/bin/webpack.js b/node_modules/webpack/bin/webpack.js index d61288841..469900c73 100755 --- a/node_modules/webpack/bin/webpack.js +++ b/node_modules/webpack/bin/webpack.js @@ -211,6 +211,12 @@ yargs.parse(process.argv.slice(2), (err, argv, output) => { if(typeof outputOptions.context === "undefined") outputOptions.context = firstOptions.context; + ifArg("env", function(value) { + if(outputOptions.env) { + outputOptions._env = value; + } + }); + ifArg("json", function(bool) { if(bool) outputOptions.json = bool; @@ -327,16 +333,19 @@ yargs.parse(process.argv.slice(2), (err, argv, output) => { var compiler; try { compiler = webpack(options); - } catch(e) { - var WebpackOptionsValidationError = require("../lib/WebpackOptionsValidationError"); - if(e instanceof WebpackOptionsValidationError) { + } catch(err) { + if(err.name === "WebpackOptionsValidationError") { if(argv.color) - console.error("\u001b[1m\u001b[31m" + e.message + "\u001b[39m\u001b[22m"); + console.error( + `\u001b[1m\u001b[31m${err.message}\u001b[39m\u001b[22m` + ); else - console.error(e.message); - process.exit(1); // eslint-disable-line no-process-exit + console.error(err.message); + // eslint-disable-next-line no-process-exit + process.exit(1); } - throw e; + + throw err; } if(argv.progress) { |