diff --git a/packages/webpack-cli/package.json b/packages/webpack-cli/package.json index 69a93981447..86b25c2d5e3 100644 --- a/packages/webpack-cli/package.json +++ b/packages/webpack-cli/package.json @@ -52,7 +52,7 @@ "@types/envinfo": "^7.8.1" }, "peerDependencies": { - "webpack": "5.x.x" + "webpack": "^5.82.0" }, "peerDependenciesMeta": { "webpack-bundle-analyzer": { diff --git a/packages/webpack-cli/src/webpack-cli.ts b/packages/webpack-cli/src/webpack-cli.ts index e25c6cc4d2a..8b29eb91f98 100644 --- a/packages/webpack-cli/src/webpack-cli.ts +++ b/packages/webpack-cli/src/webpack-cli.ts @@ -634,7 +634,7 @@ class WebpackCLI implements IWebpackCLI { makeOption(command: WebpackCLICommand, option: WebpackCLIBuiltInOption) { let mainOption: WebpackCLIMainOption; let negativeOption; - const flagsWithAlias = ["devtool", "output-path", "target", "watch"]; + const flagsWithAlias = ["devtool", "output-path", "target", "watch", "extends"]; if (flagsWithAlias.includes(option.name)) { option.alias = option.name[0]; @@ -1044,20 +1044,6 @@ class WebpackCLI implements IWebpackCLI { description: "Stop webpack-cli process with non-zero exit code on warnings from webpack.", helpLevel: "minimum", }, - // TODO remove this in the next major release, because not all webpack versions have this flag in CLI options - { - name: "extends", - alias: "e", - configs: [ - { - type: "string", - }, - ], - multiple: true, - description: - "Path to the configuration to be extended (only works when using webpack-cli).", - helpLevel: "minimum", - }, ]; // Options from webpack core to be included in the minimum help output @@ -1071,6 +1057,7 @@ class WebpackCLI implements IWebpackCLI { "target", "name", "output-path", + "extends", ]; // Extract all the flags being exported from core. diff --git a/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 b/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 index c92580463f2..473a5be356b 100644 --- a/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 +++ b/test/help/__snapshots__/help.test.js.snap.devServer5.webpack5 @@ -104,10 +104,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -161,10 +161,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -218,10 +218,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -274,10 +274,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -321,10 +321,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -368,10 +368,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -415,10 +415,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -462,10 +462,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -509,10 +509,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -836,10 +836,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -881,10 +881,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -926,10 +926,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -971,10 +971,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1016,10 +1016,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1061,10 +1061,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1107,10 +1107,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1164,10 +1164,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1411,10 +1411,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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). @@ -1466,10 +1466,10 @@ Options: --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. - -e, --extends Path to the configuration to be extended (only works when using webpack-cli). -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).