Skip to content

Commit

Permalink
fix: update description of onAfterSetupMiddleware and `onBeforeSetu…
Browse files Browse the repository at this point in the history
…pMiddleware` options (#4126)
  • Loading branch information
snitin315 committed Dec 21, 2021
1 parent 37b73d5 commit f4fb15f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/options.json
Expand Up @@ -486,12 +486,12 @@
},
"OnAfterSetupMiddleware": {
"instanceof": "Function",
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.",
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.",
"link": "https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
},
"OnBeforeSetupMiddleware": {
"instanceof": "Function",
"description": "Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares.",
"description": "Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares. Deprecated: please use the 'setupMiddlewares' option.",
"link": "https://webpack.js.org/configuration/dev-server/#devserveronbeforesetupmiddleware"
},
"OnListening": {
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/validate-options.test.js.snap.webpack4
Expand Up @@ -484,14 +484,14 @@ exports[`options validate should throw an error on the "magicHtml" option with '
exports[`options validate should throw an error on the "onAfterSetupMiddleware" option with 'false' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.onAfterSetupMiddleware should be an instance of function.
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
`;

exports[`options validate should throw an error on the "onBeforeSetupMiddleware" option with 'false' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.onBeforeSetupMiddleware should be an instance of function.
-> Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares.
-> Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronbeforesetupmiddleware"
`;

Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/validate-options.test.js.snap.webpack5
Expand Up @@ -484,14 +484,14 @@ exports[`options validate should throw an error on the "magicHtml" option with '
exports[`options validate should throw an error on the "onAfterSetupMiddleware" option with 'false' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.onAfterSetupMiddleware should be an instance of function.
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
`;

exports[`options validate should throw an error on the "onBeforeSetupMiddleware" option with 'false' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.onBeforeSetupMiddleware should be an instance of function.
-> Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares.
-> Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronbeforesetupmiddleware"
`;

Expand Down

0 comments on commit f4fb15f

Please sign in to comment.