Skip to content

Commit

Permalink
fix: help output
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jun 17, 2020
1 parent cae027e commit fd22f7d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/webpack-cli/lib/utils/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ const ADVANCED_GROUP = 'advanced';
const DISPLAY_GROUP = 'stats';
const ZERO_CONFIG_GROUP = 'zero-config';

// Extract all the flages 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 flagsFromCore = version.startsWith(5)
? Object.entries(require('webpack').cli.getArguments()).map(([flag, meta]) => {
if (meta.simpleType === 'string') {
meta.type = String;
} else if (meta.simpleType === 'number') {
meta.type = Number;
} else {
meta.type = Boolean;
}
console.log(meta.type);
return {
...meta,
name: flag,
Expand Down

0 comments on commit fd22f7d

Please sign in to comment.