From 00fae2fca6baa314b46e6207fd9bc54b141cd5f9 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Wed, 27 Jul 2022 08:42:27 +0530 Subject: [PATCH] refactor: allow aliases --- packages/webpack-cli/src/webpack-cli.ts | 5 + test/build/core-flags/core-flags.test.js | 6 +- .../target/flag-test/target-flag.test.js | 3 +- .../help.test.js.snap.devServer4.webpack5 | 761 +++++++++--------- 4 files changed, 389 insertions(+), 386 deletions(-) diff --git a/packages/webpack-cli/src/webpack-cli.ts b/packages/webpack-cli/src/webpack-cli.ts index e8d9c608c36..9e73001fabb 100644 --- a/packages/webpack-cli/src/webpack-cli.ts +++ b/packages/webpack-cli/src/webpack-cli.ts @@ -472,6 +472,11 @@ class WebpackCLI implements IWebpackCLI { makeOption(command: WebpackCLICommand, option: WebpackCLIBuiltInOption) { let mainOption: WebpackCLIMainOption; let negativeOption; + const flagsWithAlias = ["devtool", "output-path", "target", "watch"]; + + if (flagsWithAlias.includes(option.name)) { + option.alias = option.name[0]; + } if (option.configs) { let needNegativeOption = false; diff --git a/test/build/core-flags/core-flags.test.js b/test/build/core-flags/core-flags.test.js index 5c25dae29a7..a14d58d8de1 100644 --- a/test/build/core-flags/core-flags.test.js +++ b/test/build/core-flags/core-flags.test.js @@ -239,8 +239,7 @@ describe("core flags", () => { expect(stdout).toContain(`devtool: 'source-map'`); }); - // TODO: Enable alias with webpack 5 - it.skip("should allow string value devtool option using alias", async () => { + it("should allow string value devtool option using alias", async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["-d", "source-map"]); expect(exitCode).toBe(0); @@ -248,8 +247,7 @@ describe("core flags", () => { expect(stdout).toContain(`devtool: 'source-map'`); }); - // TODO: Enable alias with webpack 5 - it.skip("should allow string value devtool option using alias #1", async () => { + it("should allow string value devtool option using alias #1", async () => { // cSpell:ignore dsource const { exitCode, stderr, stdout } = await run(__dirname, ["-dsource-map"]); diff --git a/test/build/target/flag-test/target-flag.test.js b/test/build/target/flag-test/target-flag.test.js index b3bc5c7ada7..b7b0abf78e3 100644 --- a/test/build/target/flag-test/target-flag.test.js +++ b/test/build/target/flag-test/target-flag.test.js @@ -22,8 +22,7 @@ describe("--target flag", () => { expect(stdout).toContain(`target: [ '${val}' ]`); }); - // TODO: Enable aliases with webpack 5 - it.skip(`should accept ${val} with -t alias`, async () => { + it(`should accept ${val} with -t alias`, async () => { const { exitCode, stderr, stdout } = await run(__dirname, ["-t", `${val}`]); expect(exitCode).toBe(0); diff --git a/test/help/__snapshots__/help.test.js.snap.devServer4.webpack5 b/test/help/__snapshots__/help.test.js.snap.devServer4.webpack5 index 2ee067e751f..306b6f459b6 100644 --- a/test/help/__snapshots__/help.test.js.snap.devServer4.webpack5 +++ b/test/help/__snapshots__/help.test.js.snap.devServer4.webpack5 @@ -102,17 +102,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -159,17 +159,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -216,17 +216,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -264,34 +264,34 @@ exports[`help should show help information for 'b' command using command syntax: Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -308,34 +308,34 @@ exports[`help should show help information for 'b' command using the "--help" op Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -352,47 +352,47 @@ exports[`help should show help information for 'build' and respect the "--color" Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. - ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is - a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development - hints. - --name Name of the configuration. Used when loading - multiple configurations. - --output-path The output directory as **absolute path** - (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. + ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using + 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is + a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -409,47 +409,47 @@ exports[`help should show help information for 'build' and respect the "--no-col Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. - ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is - a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development - hints. - --name Name of the configuration. Used when loading - multiple configurations. - --output-path The output directory as **absolute path** - (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. + ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using + 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is + a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -466,34 +466,34 @@ exports[`help should show help information for 'build' command using command syn Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -510,34 +510,34 @@ exports[`help should show help information for 'build' command using the "--help Run webpack (default command, can be omitted). Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --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. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. 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. + --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'. @@ -1488,32 +1488,32 @@ exports[`help should show help information for 'w' command using command syntax: Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1530,32 +1530,32 @@ exports[`help should show help information for 'w' command using the "--help" op Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1572,45 +1572,45 @@ exports[`help should show help information for 'watch' and respect the "--color" Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. - ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is - a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development - hints. - --name Name of the configuration. Used when loading - multiple configurations. - --output-path The output directory as **absolute path** - (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. + ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using + 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is + a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1627,45 +1627,45 @@ exports[`help should show help information for 'watch' and respect the "--no-col Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. - ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is - a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development - hints. - --name Name of the configuration. Used when loading - multiple configurations. - --output-path The output directory as **absolute path** - (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. + ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using + 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is + a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1682,32 +1682,32 @@ exports[`help should show help information for 'watch' command using command syn Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1724,32 +1724,32 @@ exports[`help should show help information for 'watch' command using the "--help Run webpack and watch for files changes. Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret a config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --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. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - --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. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --disable-interpret Disable interpret a config file. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -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. + --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. + --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. + --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'. @@ -1775,17 +1775,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -1832,17 +1832,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -1957,6 +1957,7 @@ exports[`help should show help information using the "help --target" option: std exports[`help should show help information using the "help --target" option: stdout 1`] = ` "Usage: webpack --target +Short: webpack -t Description: Environment to build for. Environment to build for. An array of environments to build for all of them when possible. Possible values: \\"false\\" @@ -2078,17 +2079,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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. @@ -2133,17 +2134,17 @@ Options: --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. - --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + -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. --mode Enable production optimizations or development hints. --name Name of the configuration. Used when loading multiple configurations. - --output-path The output directory as **absolute path** (required). + -o, --output-path The output directory as **absolute path** (required). --stats [value] Stats options object or preset name. --no-stats Negative 'stats' option. - --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. + -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. - --watch Enter watch mode, which rebuilds on file change. + -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.