Skip to content

Commit 985a651

Browse files
committed
Implement feedback
- Rename `validateWebpackOptions` -> `validationSchema` - Export `WebpackOptionsValidationError` on webpack.
1 parent 2bbd365 commit 985a651

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

bin/convert-argv.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ fs.existsSync = fs.existsSync || path.existsSync;
44
var resolve = require("enhanced-resolve");
55
var interpret = require("interpret");
66
var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter");
7-
var validateWebpackOptions = require("../lib/validateWebpackOptions");
87

98
module.exports = function(yargs, argv, convertOptions) {
109

lib/webpack.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ var MultiCompiler = require("./MultiCompiler");
77
var NodeEnvironmentPlugin = require("./node/NodeEnvironmentPlugin");
88
var WebpackOptionsApply = require("./WebpackOptionsApply");
99
var WebpackOptionsDefaulter = require("./WebpackOptionsDefaulter");
10-
var validateWebpackOptions = require("./validateWebpackOptions");
10+
var validationSchema = require("./validationSchema");
1111
var WebpackOptionsValidationError = require("./WebpackOptionsValidationError");
1212
var webpackOptionsSchema = require("../schemas/webpackOptionsSchema.json");
1313

1414
function webpack(options, callback) {
15-
var webpackOptionsValidationErrors = validateWebpackOptions(webpackOptionsSchema, options);
15+
var webpackOptionsValidationErrors = validationSchema(webpackOptionsSchema, options);
1616
if(webpackOptionsValidationErrors.length) {
1717
throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
1818
}
@@ -53,8 +53,9 @@ webpack.WebpackOptionsApply = WebpackOptionsApply;
5353
webpack.Compiler = Compiler;
5454
webpack.MultiCompiler = MultiCompiler;
5555
webpack.NodeEnvironmentPlugin = NodeEnvironmentPlugin;
56-
webpack.validate = validateWebpackOptions.bind(this, webpackOptionsSchema);
57-
webpack.validateSchema = validateWebpackOptions;
56+
webpack.validate = validationSchema.bind(this, webpackOptionsSchema);
57+
webpack.validateSchema = validationSchema;
58+
webpack.WebpackOptionsValidationError = WebpackOptionsValidationError;
5859

5960
function exportPlugins(exports, path, plugins) {
6061
plugins.forEach(function(name) {

0 commit comments

Comments
 (0)