Skip to content

Commit

Permalink
fix: improve the description of magicHtml option (#3772)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Sep 1, 2021
1 parent dfca34e commit b80610f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -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).
Expand Down
8 changes: 6 additions & 2 deletions bin/cli-flags.js
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/options.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/validate-options.test.js.snap.webpack4
Expand Up @@ -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"
`;

Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/validate-options.test.js.snap.webpack5
Expand Up @@ -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"
`;

Expand Down
4 changes: 2 additions & 2 deletions test/cli/__snapshots__/basic.test.js.snap.webpack4
Expand Up @@ -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 <value...> Opens specified page in browser.
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack5
Expand Up @@ -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.
Expand Down

0 comments on commit b80610f

Please sign in to comment.