diff --git a/lib/options.json b/lib/options.json index 13516aa3bf..375cdf7044 100644 --- a/lib/options.json +++ b/lib/options.json @@ -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": { diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index aa3e62015a..b7ba5311b0 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -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" `; diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack5 b/test/__snapshots__/validate-options.test.js.snap.webpack5 index aa3e62015a..b7ba5311b0 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack5 @@ -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" `;