Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jul 29, 2022
1 parent 9ffb765 commit f52397b
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions packages/webpack-cli/src/webpack-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,28 +698,6 @@ class WebpackCLI implements IWebpackCLI {
return this.builtInOptionsCache;
}

const minimumHelpFlags = [
"analyze",
"config",
"config-name",
"merge",
"disable-interpret",
"env",
"mode",
"watch",
"watch-options-stdin",
"stats",
"devtool",
"entry",
"target",
"progress",
"json",
"name",
"output-path",
"node-env",
"fail-on-warnings",
];

const builtInFlags: WebpackCLIBuiltInFlag[] = [
// For configs
{
Expand Down Expand Up @@ -875,6 +853,19 @@ class WebpackCLI implements IWebpackCLI {
},
];

const minimumHelpFlags = [
...builtInFlags.map((flag) => flag.name),
"mode",
"watch",
"watch-options-stdin",
"stats",
"devtool",
"entry",
"target",
"name",
"output-path",
];

// Extract all the flags being exported from core.
// A list of cli flags generated by core can be found here https://github.com/webpack/webpack/blob/master/test/__snapshots__/Cli.test.js.snap
const coreArguments = Object.entries(this.webpack.cli.getArguments()).map(([flag, meta]) => {
Expand Down

0 comments on commit f52397b

Please sign in to comment.