From d2f49029ad04849526599fbba873a8679431c990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Wed, 10 Oct 2018 04:14:34 -0700 Subject: [PATCH] fix(options): add `writeToDisk` option to schema (#1520) --- lib/options.json | 11 +++++++++++ test/Validation.test.js | 5 +++++ 2 files changed, 16 insertions(+) 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 } },