Webpack-cli: Refactor: Move yargs options into it's own config/util file

Created on 5 Mar 2019  路  3Comments  路  Source: webpack/webpack-cli

Do you want to request a feature or report a bug?
bin/cli.js is huge and thus I want to propose the yargs options present in the file to be moved to it's own file in some util dir or something (please suggest) https://github.com/webpack/webpack-cli/blob/62ab32df0861e7c926b4b7b174326f4849812ef8/bin/cli.js#L58

I'm also not sure why we're configuring options for yargs twice here and here.

Is it possible to merge them by any means?

What is the current behavior?
bin/cli.js contains a lot of config code.

What is the expected behavior?
We can refactor it to have a much cleaner entry point.

Please paste the results of webpack-cli info here, and mention other relevant information such as programming language.

webpack-cli info

  System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
  Binaries:
    Node: 10.14.1 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 72.0.3626.119
    Safari: 12.0.3
  npmPackages:
    webpack: 4.x.x => 4.29.6
    webpack-dev-server: ^3.1.10 => 3.2.1
enhancement

Most helpful comment

No that's a new thang

All 3 comments

Also +1 for sticking with JS for the CLI code, it's really easy to skimp through. 馃槃

Thanks for posting issue @anshumanv and the PR :100:
@evenstensberg this refactoring is done on next branch (as new CLI would be launching soon ), do we also need it here?

No that's a new thang

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fokusferit picture fokusferit  路  5Comments

heyalbert picture heyalbert  路  3Comments

larkintuckerllc picture larkintuckerllc  路  5Comments

aleksandrlat picture aleksandrlat  路  3Comments

RobotnickIsrael picture RobotnickIsrael  路  5Comments