Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve description of magicHtml option #3772

Merged
merged 1 commit into from Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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