mirror of https://github.com/webpack/webpack.git
fixed some validation stuff
This commit is contained in:
parent
f1446232c6
commit
c675067bcf
|
@ -554,11 +554,5 @@ 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("Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. The following checks have failed.", webpackOptionsValidationErrors);
|
||||
process.exit(-1); // eslint-disable-line
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -264,7 +264,20 @@ function processOptions(options) {
|
|||
|
||||
Error.stackTraceLimit = 30;
|
||||
var lastHash = null;
|
||||
var compiler = webpack(options);
|
||||
var compiler;
|
||||
try {
|
||||
compiler = webpack(options);
|
||||
} catch(e) {
|
||||
var WebpackOptionsValidationError = require("../lib/WebpackOptionsValidationError");
|
||||
if(e instanceof WebpackOptionsValidationError) {
|
||||
if(argv.color)
|
||||
console.error("\u001b[1m\u001b[31m" + e.message + "\u001b[39m\u001b[22m");
|
||||
else
|
||||
console.error(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
if(argv.progress) {
|
||||
var ProgressPlugin = require("../lib/ProgressPlugin");
|
||||
|
|
|
@ -7,7 +7,6 @@ var Template = require("./Template");
|
|||
|
||||
function WebpackOptionsDefaulter() {
|
||||
OptionsDefaulter.call(this);
|
||||
this.set("debug", false);
|
||||
this.set("devtool", false);
|
||||
this.set("cache", true);
|
||||
|
||||
|
|
|
@ -382,6 +382,18 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"hashFunction": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"hashDigest": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"hashDigestLength": {
|
||||
"type": "number",
|
||||
"minimum": 1
|
||||
},
|
||||
"chunkFilename": {
|
||||
"description": "The filename of non-entry chunks as relative path inside the `output.path` directory.",
|
||||
"type": "string"
|
||||
|
|
Loading…
Reference in New Issue