Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(options): add writeToDisk option to schema #1520

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
"watchOptions": {
"type": "object"
},
"writeToDisk": {
"anyOf": [
{
"type": "boolean"
},
{
"instanceof": "Function"
}
]
},
"headers": {
"type": "object"
},
Expand Down Expand Up @@ -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)",
Expand Down
5 changes: 5 additions & 0 deletions test/Validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down