diff --git a/README.md b/README.md index 731e2050a5..598dcbcd3c 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,8 @@ Options: --ipc [value] Listen to a unix socket. --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default). --no-live-reload Negative 'live-reload' option. - --magic-html Enables/Disables magic HTML routes (enabled by default). + --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for + example '/main' for 'main.js'). --no-magic-html Negative 'magic-html' option. --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser). diff --git a/bin/cli-flags.js b/bin/cli-flags.js index 36d94ca44f..ed9aece694 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -539,11 +539,15 @@ module.exports = { { type: "boolean", multiple: false, - description: "Enables/Disables magic HTML routes (enabled by default).", + description: + "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", path: "magicHtml", }, ], - description: "Enables/Disables magic HTML routes (enabled by default).", + description: + "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", + negatedDescription: + "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", simpleType: "boolean", multiple: false, }, diff --git a/lib/options.json b/lib/options.json index 8cc59dc8ed..dba43c89f1 100644 --- a/lib/options.json +++ b/lib/options.json @@ -333,7 +333,7 @@ }, "MagicHTML": { "type": "boolean", - "description": "Enables/Disables magic HTML routes (enabled by default).", + "description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", "link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml" }, "OnAfterSetupMiddleware": { diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index 2000a987b1..c74393cbf8 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -442,7 +442,7 @@ exports[`options validate should throw an error on the "liveReload" option with exports[`options validate should throw an error on the "magicHtml" option with 'string' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.magicHtml should be a boolean. - -> Enables/Disables magic HTML routes (enabled by default). + -> Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). -> Read more at https://webpack.js.org/configuration/dev-server/#devservermagichtml" `; diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack5 b/test/__snapshots__/validate-options.test.js.snap.webpack5 index 2000a987b1..c74393cbf8 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack5 @@ -442,7 +442,7 @@ exports[`options validate should throw an error on the "liveReload" option with exports[`options validate should throw an error on the "magicHtml" option with 'string' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.magicHtml should be a boolean. - -> Enables/Disables magic HTML routes (enabled by default). + -> Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). -> Read more at https://webpack.js.org/configuration/dev-server/#devservermagichtml" `; diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack4 b/test/cli/__snapshots__/basic.test.js.snap.webpack4 index 5d02f9c6e4..27f826749d 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack4 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack4 @@ -99,8 +99,8 @@ Options: --ipc [value] Listen to a unix socket. --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default). --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default) - --magic-html Enables/Disables magic HTML routes (enabled by default). - --no-magic-html Negative 'magic-html' option. + --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). + --no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser). --no-open Does not open the default browser. --open-target Opens specified page in browser. diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index 3703b3570b..a9abd9cc46 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -98,7 +98,7 @@ Options: --ipc [value] Listen to a unix socket. --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default). --no-live-reload Negative 'live-reload' option. - --magic-html Enables/Disables magic HTML routes (enabled by default). + --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). --no-magic-html Negative 'magic-html' option. --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser). --no-open Negative 'open' option.