Skip to content

Commit d2f4902

Browse files
oNaiPsmichael-ciniawsky
authored andcommitted
fix(options): add writeToDisk option to schema (#1520)
1 parent bb484ad commit d2f4902

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/options.json

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@
5454
"watchOptions": {
5555
"type": "object"
5656
},
57+
"writeToDisk": {
58+
"anyOf": [
59+
{
60+
"type": "boolean"
61+
},
62+
{
63+
"instanceof": "Function"
64+
}
65+
]
66+
},
5767
"headers": {
5868
"type": "object"
5969
},
@@ -312,6 +322,7 @@
312322
"port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)",
313323
"socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)",
314324
"watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)",
325+
"writeToDisk": "should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)",
315326
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)",
316327
"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)",
317328
"overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)",

test/Validation.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ describe('Validation', () => {
2626
config: { logLevel: 1 },
2727
message: 'options.logLevel should be {String} and equal to one of the allowed values'
2828
},
29+
{
30+
name: 'invalid `writeToDisk` configuration',
31+
config: { writeToDisk: 1 },
32+
message: 'options.writeToDisk should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)\n'
33+
},
2934
{
3035
name: 'invalid `overlay` configuration',
3136
config: { overlay: { errors: 1 } },

0 commit comments

Comments
 (0)