Skip to content

Commit

Permalink
refactor: order
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 20, 2023
1 parent 5a87296 commit 7e92f5c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/webpack-cli/src/webpack-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,16 +991,18 @@ class WebpackCLI implements IWebpackCLI {

// 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/main/test/__snapshots__/Cli.basictest.js.snap
const options = Object.entries(this.webpack.cli.getArguments())
.map<WebpackCLIBuiltInOption>(([name, meta]) => {
return {
...meta,
name,
group: "core",
helpLevel: minimumHelpFlags.includes(name) ? "minimum" : "verbose",
};
})
.concat(builtInFlags);
const options = builtInFlags.concat(
Object.entries(this.webpack.cli.getArguments())
.map<WebpackCLIBuiltInOption>(([name, meta]) => {
return {
...meta,
name,
group: "core",
helpLevel: minimumHelpFlags.includes(name) ? "minimum" : "verbose",
};
})
.concat(builtInFlags),
);

this.builtInOptionsCache = options;

Expand Down

0 comments on commit 7e92f5c

Please sign in to comment.