Webpack-cli: feat: add config-name flag

Created on 1 Aug 2020  路  10Comments  路  Source: webpack/webpack-cli

Is your feature request related to a problem? Please describe.

Allow passing the config name from the CLI to determine which config to use when there are multiple - https://webpack.js.org/configuration/other-options/#name
It's in v3 but seems to be removed from here for some reason

Describe the solution you'd like
Just need to create a flag and add tests

Describe alternatives you've considered
flag seems the most appropriate

Additional context
@webpack/cli-team do you have any other ideas about this?

Most helpful comment

Yes, we have it for v5, nice to have it for v4 too.

All 10 comments

I think we already have it for webpack@5, but I think it will be great to webpack@4 too

/cc @snitin315

great on it

Yes, we have it for v5, nice to have it for v4 too.

I think we should implement this before https://github.com/webpack/webpack-cli/issues/1657

yeah makes sense to add this first

will check it out, this should simply be about passing the the name to compiler or filter the config as per name in the CLI and then pass that config?

I'm not sure but I think the only difference between this and #1657 should be the support of multiple values?

@anshumanv webpack --name=web should only set options.name = 'web'. i.e, simply about passing the name to compiler.

yeah seems straightforward, will PR today

Completed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evenstensberg picture evenstensberg  路  5Comments

anyulled picture anyulled  路  4Comments

fokusferit picture fokusferit  路  4Comments

AjayPoshak picture AjayPoshak  路  5Comments

anshumanv picture anshumanv  路  3Comments