Skip to content

Commit f4fb15f

Browse files
authored
fix: update description of onAfterSetupMiddleware and onBeforeSetupMiddleware options (#4126)
1 parent 37b73d5 commit f4fb15f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,12 @@
486486
},
487487
"OnAfterSetupMiddleware": {
488488
"instanceof": "Function",
489-
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.",
489+
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.",
490490
"link": "https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
491491
},
492492
"OnBeforeSetupMiddleware": {
493493
"instanceof": "Function",
494-
"description": "Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares.",
494+
"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.",
495495
"link": "https://webpack.js.org/configuration/dev-server/#devserveronbeforesetupmiddleware"
496496
},
497497
"OnListening": {

test/__snapshots__/validate-options.test.js.snap.webpack4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,14 @@ exports[`options validate should throw an error on the "magicHtml" option with '
484484
exports[`options validate should throw an error on the "onAfterSetupMiddleware" option with 'false' value 1`] = `
485485
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
486486
- options.onAfterSetupMiddleware should be an instance of function.
487-
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.
487+
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
488488
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
489489
`;
490490

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

test/__snapshots__/validate-options.test.js.snap.webpack5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,14 @@ exports[`options validate should throw an error on the "magicHtml" option with '
484484
exports[`options validate should throw an error on the "onAfterSetupMiddleware" option with 'false' value 1`] = `
485485
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
486486
- options.onAfterSetupMiddleware should be an instance of function.
487-
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.
487+
-> Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.
488488
-> Read more at https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
489489
`;
490490

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

0 commit comments

Comments
 (0)