From cb3cb2710de21859ff9a75e0d586b40d2696f4b8 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 01:59:01 +0300 Subject: [PATCH 1/3] refactor: fix blocking in span processes --- scripts/set-blocking.js | 3 + scripts/update-docs.js | 8 +- .../help.test.js.snap.devServer5.webpack5 | 1376 +++++++++++++++++ test/help/help.test.js | 105 +- test/help/set-blocking.js | 3 + 5 files changed, 1437 insertions(+), 58 deletions(-) create mode 100644 scripts/set-blocking.js create mode 100644 test/help/set-blocking.js diff --git a/scripts/set-blocking.js b/scripts/set-blocking.js new file mode 100644 index 00000000000..ba4ceb39891 --- /dev/null +++ b/scripts/set-blocking.js @@ -0,0 +1,3 @@ +"use strict"; + +process.stdout._handle.setBlocking(true); diff --git a/scripts/update-docs.js b/scripts/update-docs.js index bc40b3f597e..abb6d413f1d 100644 --- a/scripts/update-docs.js +++ b/scripts/update-docs.js @@ -8,12 +8,13 @@ const [majorDevServerVersion] = version.split("."); * @returns {Promise} */ async function updateDocs() { - const { execa } = await import("execa"); - const { stdout: cliOptions } = await execa( + const { execaNode } = await import("execa"); + const { stdout: cliOptions } = await execaNode( resolve(__dirname, "../packages/webpack-cli/bin/cli.js"), ["--help=verbose", "--no-color"], { cwd: __dirname, + nodeOptions: [`--import=${resolve(__dirname, "./set-blocking.js")}`], }, ); @@ -24,11 +25,12 @@ async function updateDocs() { writeFileSync("OPTIONS.md", mdContent); // serve options - const { stdout: serveOptions } = await execa( + const { stdout: serveOptions } = await execaNode( resolve(__dirname, "../packages/webpack-cli/bin/cli.js"), ["serve", "--help", "--no-color"], { cwd: __dirname, + nodeOptions: [`--import=${resolve(__dirname, "./set-blocking.js")}`], }, ); diff --git a/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 b/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 index 963ffb8c730..57f4dd4b362 100644 --- a/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 +++ b/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 @@ -307,6 +307,52 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'b' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'b' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack build|bundle|b [entries...] [options] + +Run webpack (default command, can be omitted). + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + --watch-options-poll [value] \`number\`: use polling with specified interval. \`true\`: use polling. + --no-watch-options-poll Negative 'watch-options-poll' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'b' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'b' command using the "--help" option: stdout 1`] = ` @@ -499,6 +545,52 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'build' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'build' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack build|bundle|b [entries...] [options] + +Run webpack (default command, can be omitted). + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + --watch-options-poll [value] \`number\`: use polling with specified interval. \`true\`: use polling. + --no-watch-options-poll Negative 'watch-options-poll' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'build' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'build' command using the "--help" option: stdout 1`] = ` @@ -607,6 +699,26 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'configtest' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'configtest' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack configtest|t [config-path] + +Validate a webpack configuration. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'configtest' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'configtest' command using the "--help" option: stdout 1`] = ` @@ -651,6 +763,30 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'i' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'i' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack info|i [options] + +Outputs information about your system. + +Options: + -o, --output To get the output in a specified format ( accept json or markdown ) + -a, --additional-package Adds additional packages to the output + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'i' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'i' command using the "--help" option: stdout 1`] = ` @@ -747,6 +883,30 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'info' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'info' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack info|i [options] + +Outputs information about your system. + +Options: + -o, --output To get the output in a specified format ( accept json or markdown ) + -a, --additional-package Adds additional packages to the output + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'info' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'info' command using the "--help" option: stdout 1`] = ` @@ -773,20 +933,1098 @@ Made with ♥ by the webpack team." exports[`help should show help information for 's' command using command syntax: stderr 1`] = `""`; +exports[`help should show help information for 's' command using command syntax: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`help should show help information for 's' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 's' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 's' command using the "--help" option: stderr 1`] = `""`; +exports[`help should show help information for 's' command using the "--help" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'serve' and respect the "--color" flag using the "--help" option: stderr 1`] = `""`; +exports[`help should show help information for 'serve' and respect the "--color" flag using the "--help" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'serve' and respect the "--no-color" flag using the "--help" option: stderr 1`] = `""`; +exports[`help should show help information for 'serve' and respect the "--no-color" flag using the "--help" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'serve' command using command syntax: stderr 1`] = `""`; +exports[`help should show help information for 'serve' command using command syntax: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`help should show help information for 'serve' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'serve' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'serve' command using the "--help" option: stderr 1`] = `""`; +exports[`help should show help information for 'serve' command using the "--help" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'server' command using command syntax: stderr 1`] = `""`; +exports[`help should show help information for 'server' command using command syntax: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`help should show help information for 'server' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'server' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'server' command using the "--help" option: stderr 1`] = `""`; +exports[`help should show help information for 'server' command using the "--help" option: stdout 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server and watch for source file changes while serving. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + --no-devtool Negative 'devtool' option. + --entry A module that is loaded upon startup. Only the last one is exported. + -e, --extends Path to the configuration to be extended (only works when using webpack-cli). + --mode Enable production optimizations or development hints. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path The output directory as **absolute path** (required). + --stats [value] Stats options object or preset name. + --no-stats Negative 'stats' option. + -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + --no-target Negative 'target' option. + -w, --watch Enter watch mode, which rebuilds on file change. + --no-watch Negative 'watch' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). + --bonjour Allows to broadcasts dev server via ZeroConf networking on start. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. + --no-client Disables client script. + --client-logging Allows to set log level in the browser. + --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Disables the full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors. + --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings. + --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors. + --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors. + --client-overlay-trusted-types-policy-name The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'. + --client-progress [value] Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators. + --no-client-progress Does not display compilation progress in the browser. + --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. + --no-client-reconnect Tells dev-server to not to try to reconnect the client. + --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. + --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). + --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. + --compress Enables gzip compression for everything served. + --no-compress Disables gzip compression for everything served. + --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. + --no-history-api-fallback Disallows to proxy requests through a specified index page. + --host Allows to specify a hostname to use. + --hot [value] Enables Hot Module Replacement. + --no-hot Disables Hot Module Replacement. + --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). + --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. + --open-app-name Open specified browser. + --open-reset Clear all items provided in 'open' configuration. 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). + --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser. + --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser. + --port Allows to specify a port to use. + --server-type Allows to set server and options (by default 'http'). + --server-options-passphrase Passphrase for a pfx file. + --server-options-request-cert Request for an SSL certificate. + --no-server-options-request-cert Does not request for an SSL certificate. + --server-options-ca Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. + --server-options-cert Path to an SSL certificate or content of an SSL certificate. + --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate. + --server-options-crl Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-crl-reset Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). + --server-options-key Path to an SSL key or content of an SSL key. + --server-options-key-reset Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key. + --server-options-pfx Path to an SSL pfx file or content of an SSL pfx file. + --server-options-pfx-reset Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. + --static [value...] Allows to configure options for serving static files from directory (by default 'public' directory). + --no-static Disallows to configure options for serving static files from directory. + --static-directory Directory for static contents. + --static-public-path The static files will be available in the browser under this public path. + --static-serve-index Tells dev server to use serveIndex middleware when enabled. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. + --static-watch Watches for files in static content directory. + --no-static-watch Does not watch for files in static content directory. + --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). + --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. + --watch-files Allows to configure list of globs/directories/files to watch for file changes. + --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes. + --no-web-socket-server Disallows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options (by default 'ws'). + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 't' command using command syntax: stderr 1`] = `""`; exports[`help should show help information for 't' command using command syntax: stdout 1`] = ` @@ -807,6 +2045,26 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 't' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 't' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack configtest|t [config-path] + +Validate a webpack configuration. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 't' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 't' command using the "--help" option: stdout 1`] = ` @@ -873,6 +2131,52 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'w' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'w' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack watch|w [entries...] [options] + +Run webpack and watch for files changes. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + --watch-options-poll [value] \`number\`: use polling with specified interval. \`true\`: use polling. + --no-watch-options-poll Negative 'watch-options-poll' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'w' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'w' command using the "--help" option: stdout 1`] = ` @@ -1057,6 +2361,52 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information for 'watch' command using the "--help verbose" option: stderr 1`] = `""`; + +exports[`help should show help information for 'watch' command using the "--help verbose" option: stdout 1`] = ` +"Usage: webpack watch|w [entries...] [options] + +Run webpack and watch for files changes. + +Options: + -c, --config Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js". + --config-name Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret for loading the config file. + --env Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval". + --node-env Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead) + --config-node-env Sets process.env.NODE_ENV to the specified value for access within the configuration. + --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. + --progress [value] Print compilation progress during build. + -j, --json [pathToJsonFile] Prints result as JSON or store it in a file. + --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack. + --no-amd Negative 'amd' option. + --bail Report the first error as a hard error instead of tolerating it. + --no-bail Negative 'bail' option. + --cache Enable in memory caching. Disable caching. + --no-cache Negative 'cache' option. + --cache-cache-unaffected Additionally cache computation of modules that are unchanged and reference only unchanged modules. + --no-cache-cache-unaffected Negative 'cache-cache-unaffected' option. + --cache-max-generations Number of generations unused cache entries stay in memory cache + at stack. + --watch-options-poll [value] \`number\`: use polling with specified interval. \`true\`: use polling. + --no-watch-options-poll Negative 'watch-options-poll' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Negative 'watch-options-stdin' option. + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information for 'watch' command using the "--help" option: stderr 1`] = `""`; exports[`help should show help information for 'watch' command using the "--help" option: stdout 1`] = ` @@ -1161,6 +2511,32 @@ CLI documentation: https://webpack.js.org/api/cli/. Made with ♥ by the webpack team." `; +exports[`help should show help information using the "--help" option with the "verbose" value #2: stderr 1`] = `""`; + +exports[`help should show help information using the "--help" option with the "verbose" value #2: stdout 1`] = ` +"Usage: webpack [entries...] [options] +Alternative usage to run commands: webpack [command] [options] + +The build tool for modern web applications. +... +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`help should show help information using the "--help" option with the "verbose" value: stderr 1`] = `""`; + +exports[`help should show help information using the "--help" option with the "verbose" value: stdout 1`] = ` +"Usage: webpack [entries...] [options] +Alternative usage to run commands: webpack [command] [options] + +The build tool for modern web applications. +... +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + exports[`help should show help information using the "--help" option: stderr 1`] = `""`; exports[`help should show help information using the "--help" option: stdout 1`] = ` diff --git a/test/help/help.test.js b/test/help/help.test.js index dc6c9077e7e..a4552acfed5 100644 --- a/test/help/help.test.js +++ b/test/help/help.test.js @@ -1,5 +1,6 @@ "use strict"; +const path = require("node:path"); const { normalizeStderr, normalizeStdout, run } = require("../utils/test-utils"); describe("help", () => { @@ -11,22 +12,29 @@ describe("help", () => { expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); - // eslint-disable-next-line jest/no-disabled-tests - it.skip('should show help information using the "--help" option with the "verbose" value', async () => { - const { exitCode, stderr, stdout } = await run(__dirname, ["--help", "verbose"]); + it('should show help information using the "--help" option with the "verbose" value', async () => { + const { exitCode, stderr, stdout } = await run(__dirname, ["--help", "verbose"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); + // Since the output file is very large, let's make sure we have a header and footer. + expect( + `${normalizeStdout(stdout.slice(0, 145))}\n...\n${normalizeStdout(stdout.slice(-132))}`, + ).toMatchSnapshot("stdout"); }); - // eslint-disable-next-line jest/no-disabled-tests - it.skip('should show help information using the "--help" option with the "verbose" value #2', async () => { - const { exitCode, stderr, stdout } = await run(__dirname, ["--help=verbose"]); + it('should show help information using the "--help" option with the "verbose" value #2', async () => { + const { exitCode, stderr, stdout } = await run(__dirname, ["--help=verbose"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); + expect( + `${normalizeStdout(stdout.slice(0, 145))}\n...\n${normalizeStdout(stdout.slice(-132))}`, + ).toMatchSnapshot("stdout"); }); it("should show help information using command syntax", async () => { @@ -99,102 +107,89 @@ describe("help", () => { ]; for (const { name, alias } of commands) { - // TODO fix it - const needSkip = name === "serve"; - it(`should show help information for '${name}' command using the "--help" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help"]); + const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); - // eslint-disable-next-line jest/no-disabled-tests - it.skip(`should show help information for '${name}' command using the "--help verbose" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "verbose"]); + it(`should show help information for '${name}' command using the "--help verbose" option`, async () => { + const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "verbose"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); it(`should show help information for '${name}' command using command syntax`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, ["help", name]); + const { exitCode, stderr, stdout } = await run(__dirname, ["help", name], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); it(`should show help information for '${name}' and respect the "--color" flag using the "--help" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--color"]); + const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--color"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); expect(stdout).toContain("\u001B[1m"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); it(`should show help information for '${name}' and respect the "--no-color" flag using the "--help" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--no-color"]); + const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--no-color"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); expect(stdout).not.toContain("\u001B[1m"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); const aliases = Array.isArray(alias) ? alias : [alias]; for (const alias of aliases) { it(`should show help information for '${alias}' command using the "--help" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help"]); + const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); - // eslint-disable-next-line jest/no-disabled-tests - it.skip(`should show help information for '${alias}' command using the "--help verbose" option`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help", "verbose"]); + it(`should show help information for '${alias}' command using the "--help verbose" option`, async () => { + const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help", "verbose"], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); it(`should show help information for '${alias}' command using command syntax`, async () => { - const { exitCode, stderr, stdout } = await run(__dirname, ["help", alias]); + const { exitCode, stderr, stdout } = await run(__dirname, ["help", alias], { + nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + }); expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - - if (!needSkip) { - expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); - } + expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); } } diff --git a/test/help/set-blocking.js b/test/help/set-blocking.js new file mode 100644 index 00000000000..ba4ceb39891 --- /dev/null +++ b/test/help/set-blocking.js @@ -0,0 +1,3 @@ +"use strict"; + +process.stdout._handle.setBlocking(true); From 4c70051fd05ef0142db7ad228082cf9987e8eb8d Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 02:23:22 +0300 Subject: [PATCH 2/3] test: debug windows --- test/help/help.test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/help/help.test.js b/test/help/help.test.js index a4552acfed5..b9bc5a0ee41 100644 --- a/test/help/help.test.js +++ b/test/help/help.test.js @@ -12,11 +12,16 @@ describe("help", () => { expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); - it('should show help information using the "--help" option with the "verbose" value', async () => { + // eslint-disable-next-line jest/no-focused-tests + it.only('should show help information using the "--help" option with the "verbose" value', async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["--help", "verbose"], { nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], }); + console.log(exitCode); + console.log(stderr); + console.log(stdout); + expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); // Since the output file is very large, let's make sure we have a header and footer. From d980d77865db16e3918ecfb1bcc0ed879cab22ff Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 02:30:20 +0300 Subject: [PATCH 3/3] test: fix --- scripts/update-docs.js | 3 ++- test/help/help.test.js | 30 ++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/scripts/update-docs.js b/scripts/update-docs.js index abb6d413f1d..6382a77c1b2 100644 --- a/scripts/update-docs.js +++ b/scripts/update-docs.js @@ -1,5 +1,6 @@ const { writeFileSync } = require("node:fs"); const { resolve } = require("node:path"); +const { pathToFileURL } = require("node:url"); const { version } = require("webpack-dev-server/package.json"); const [majorDevServerVersion] = version.split("."); @@ -14,7 +15,7 @@ async function updateDocs() { ["--help=verbose", "--no-color"], { cwd: __dirname, - nodeOptions: [`--import=${resolve(__dirname, "./set-blocking.js")}`], + nodeOptions: [`--import=${pathToFileURL(resolve(__dirname, "./set-blocking.js"))}`], }, ); diff --git a/test/help/help.test.js b/test/help/help.test.js index b9bc5a0ee41..b8d844a7c1d 100644 --- a/test/help/help.test.js +++ b/test/help/help.test.js @@ -1,8 +1,11 @@ "use strict"; const path = require("node:path"); +const { pathToFileURL } = require("node:url"); const { normalizeStderr, normalizeStdout, run } = require("../utils/test-utils"); +const nodeOptions = [`--import=${pathToFileURL(path.resolve(__dirname, "./set-blocking.js"))}`]; + describe("help", () => { it('should show help information using the "--help" option', async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["--help"]); @@ -12,16 +15,11 @@ describe("help", () => { expect(normalizeStdout(stdout)).toMatchSnapshot("stdout"); }); - // eslint-disable-next-line jest/no-focused-tests - it.only('should show help information using the "--help" option with the "verbose" value', async () => { + it('should show help information using the "--help" option with the "verbose" value', async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["--help", "verbose"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); - console.log(exitCode); - console.log(stderr); - console.log(stdout); - expect(exitCode).toBe(0); expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); // Since the output file is very large, let's make sure we have a header and footer. @@ -32,7 +30,7 @@ describe("help", () => { it('should show help information using the "--help" option with the "verbose" value #2', async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["--help=verbose"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -114,7 +112,7 @@ describe("help", () => { for (const { name, alias } of commands) { it(`should show help information for '${name}' command using the "--help" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -124,7 +122,7 @@ describe("help", () => { it(`should show help information for '${name}' command using the "--help verbose" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "verbose"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -134,7 +132,7 @@ describe("help", () => { it(`should show help information for '${name}' command using command syntax`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["help", name], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -144,7 +142,7 @@ describe("help", () => { it(`should show help information for '${name}' and respect the "--color" flag using the "--help" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--color"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -155,7 +153,7 @@ describe("help", () => { it(`should show help information for '${name}' and respect the "--no-color" flag using the "--help" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [name, "--help", "--no-color"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -169,7 +167,7 @@ describe("help", () => { for (const alias of aliases) { it(`should show help information for '${alias}' command using the "--help" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -179,7 +177,7 @@ describe("help", () => { it(`should show help information for '${alias}' command using the "--help verbose" option`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, [alias, "--help", "verbose"], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0); @@ -189,7 +187,7 @@ describe("help", () => { it(`should show help information for '${alias}' command using command syntax`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["help", alias], { - nodeOptions: [`--import=${path.resolve(__dirname, "./set-blocking.js")}`], + nodeOptions, }); expect(exitCode).toBe(0);