Skip to content

Commit 1f000e1

Browse files
refactor: remove dead code
1 parent 483637a commit 1f000e1

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

packages/webpack-cli/src/webpack-cli.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,11 @@ class WebpackCLI {
776776
}
777777

778778
if (mainOption.type.size > 1 && mainOption.type.has(Boolean)) {
779-
mainOption.flags = `${mainOption.flags} [${mainOption.valueName || "value"}${
779+
mainOption.flags = `${mainOption.flags} [${mainOption.valueName}${
780780
mainOption.multiple ? "..." : ""
781781
}]`;
782782
} else if (mainOption.type.size > 0 && !mainOption.type.has(Boolean)) {
783-
mainOption.flags = `${mainOption.flags} <${mainOption.valueName || "value"}${
783+
mainOption.flags = `${mainOption.flags} <${mainOption.valueName}${
784784
mainOption.multiple ? "..." : ""
785785
}>`;
786786
}
@@ -839,10 +839,6 @@ class WebpackCLI {
839839

840840
optionForCommand.hidden = option.hidden || false;
841841

842-
if (option.configs) {
843-
(optionForCommand as Option & { configs: ArgumentConfig[] }).configs = option.configs;
844-
}
845-
846842
command.addOption(optionForCommand);
847843
}
848844
} else if (mainOption.type.size > 1) {
@@ -1165,17 +1161,8 @@ class WebpackCLI {
11651161
const command = await this.#loadCommandByName(name);
11661162

11671163
if (!command) {
1168-
const builtInCommandUsed = Object.values(this.#commands).find(
1169-
(command) => command.name.includes(name) || name === command.alias,
1170-
);
1171-
if (typeof builtInCommandUsed !== "undefined") {
1172-
this.logger.error(
1173-
`For using '${name}' command you need to install '${builtInCommandUsed.pkg}' package.`,
1174-
);
1175-
} else {
1176-
this.logger.error(`Can't find and load command '${name}'`);
1177-
this.logger.error("Run 'webpack --help' to see available commands and options.");
1178-
}
1164+
this.logger.error(`Can't find and load command '${name}'`);
1165+
this.logger.error("Run 'webpack --help' to see available commands and options.");
11791166
process.exit(2);
11801167
}
11811168

@@ -1243,10 +1230,6 @@ class WebpackCLI {
12431230
this.logger.raw(`${bold("Description:")} ${option.description}`);
12441231
}
12451232

1246-
if (!option.negate && option.defaultValue) {
1247-
this.logger.raw(`${bold("Default value:")} ${JSON.stringify(option.defaultValue)}`);
1248-
}
1249-
12501233
const { configs } = option as Option & { configs?: ArgumentConfig[] };
12511234

12521235
if (configs) {

0 commit comments

Comments
 (0)