diff --git a/lib/options.json b/lib/options.json index b7781109c9..fd60b5aaa0 100644 --- a/lib/options.json +++ b/lib/options.json @@ -54,6 +54,16 @@ "watchOptions": { "type": "object" }, + "writeToDisk": { + "anyOf": [ + { + "type": "boolean" + }, + { + "instanceof": "Function" + } + ] + }, "headers": { "type": "object" }, @@ -312,6 +322,7 @@ "port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)", "socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)", "watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)", + "writeToDisk": "should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)", "headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)", "clientLogLevel": "should be {String} and equal to one of the allowed values\n\n [ 'trace', 'debug', 'info', 'warn', 'error', 'silent' ]\n\n(https://webpack.js.org/configuration/dev-server/#devserver-clientloglevel)", "overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)", diff --git a/test/Validation.test.js b/test/Validation.test.js index 413f0dfd5a..12c54d7e83 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -26,6 +26,11 @@ describe('Validation', () => { config: { logLevel: 1 }, message: 'options.logLevel should be {String} and equal to one of the allowed values' }, + { + name: 'invalid `writeToDisk` configuration', + config: { writeToDisk: 1 }, + message: 'options.writeToDisk should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)\n' + }, { name: 'invalid `overlay` configuration', config: { overlay: { errors: 1 } },