Skip to content

Commit b80610f

Browse files
authored
fix: improve the description of magicHtml option (#3772)
1 parent dfca34e commit b80610f

7 files changed

+14
-9
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Options:
132132
--ipc [value] Listen to a unix socket.
133133
--live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
134134
--no-live-reload Negative 'live-reload' option.
135-
--magic-html Enables/Disables magic HTML routes (enabled by default).
135+
--magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for
136+
example '/main' for 'main.js').
136137
--no-magic-html Negative 'magic-html' option.
137138
--open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to
138139
true to open your default browser).

Diff for: bin/cli-flags.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,15 @@ module.exports = {
539539
{
540540
type: "boolean",
541541
multiple: false,
542-
description: "Enables/Disables magic HTML routes (enabled by default).",
542+
description:
543+
"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
543544
path: "magicHtml",
544545
},
545546
],
546-
description: "Enables/Disables magic HTML routes (enabled by default).",
547+
description:
548+
"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
549+
negatedDescription:
550+
"Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
547551
simpleType: "boolean",
548552
multiple: false,
549553
},

Diff for: lib/options.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
},
334334
"MagicHTML": {
335335
"type": "boolean",
336-
"description": "Enables/Disables magic HTML routes (enabled by default).",
336+
"description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
337337
"link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml"
338338
},
339339
"OnAfterSetupMiddleware": {

Diff for: test/__snapshots__/validate-options.test.js.snap.webpack4

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ exports[`options validate should throw an error on the "liveReload" option with
442442
exports[`options validate should throw an error on the "magicHtml" option with 'string' value 1`] = `
443443
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
444444
- options.magicHtml should be a boolean.
445-
-> Enables/Disables magic HTML routes (enabled by default).
445+
-> Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
446446
-> Read more at https://webpack.js.org/configuration/dev-server/#devservermagichtml"
447447
`;
448448

Diff for: test/__snapshots__/validate-options.test.js.snap.webpack5

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ exports[`options validate should throw an error on the "liveReload" option with
442442
exports[`options validate should throw an error on the "magicHtml" option with 'string' value 1`] = `
443443
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
444444
- options.magicHtml should be a boolean.
445-
-> Enables/Disables magic HTML routes (enabled by default).
445+
-> Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
446446
-> Read more at https://webpack.js.org/configuration/dev-server/#devservermagichtml"
447447
`;
448448

Diff for: test/cli/__snapshots__/basic.test.js.snap.webpack4

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ Options:
9999
--ipc [value] Listen to a unix socket.
100100
--live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
101101
--no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default)
102-
--magic-html Enables/Disables magic HTML routes (enabled by default).
103-
--no-magic-html Negative 'magic-html' option.
102+
--magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
103+
--no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
104104
--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).
105105
--no-open Does not open the default browser.
106106
--open-target <value...> Opens specified page in browser.

Diff for: test/cli/__snapshots__/basic.test.js.snap.webpack5

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Options:
9898
--ipc [value] Listen to a unix socket.
9999
--live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
100100
--no-live-reload Negative 'live-reload' option.
101-
--magic-html Enables/Disables magic HTML routes (enabled by default).
101+
--magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
102102
--no-magic-html Negative 'magic-html' option.
103103
--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).
104104
--no-open Negative 'open' option.

0 commit comments

Comments
 (0)