diff --git a/bin/convert-argv.js b/bin/convert-argv.js index 88d527431aa..fa35e7e04a2 100644 --- a/bin/convert-argv.js +++ b/bin/convert-argv.js @@ -4,6 +4,7 @@ fs.existsSync = fs.existsSync || path.existsSync; var resolve = require("enhanced-resolve"); var interpret = require("interpret"); var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter"); +var validateWebpackOptions = require("../lib/validateWebpackOptions"); module.exports = function(optimist, argv, convertOptions) { @@ -553,5 +554,11 @@ module.exports = function(optimist, argv, convertOptions) { console.error("Use --help to display the CLI options."); process.exit(-1); // eslint-disable-line } + var webpackOptionsValidationErrors = validateWebpackOptions(options); + + if (webpackOptionsValidationErrors.length) { + console.error("Configuration is invalid. Fix the following errors:", webpackOptionsValidationErrors); + process.exit(-1); // eslint-disable-line + } } };