webpack/webpack-cli

Error: Unknown option '--profile'

harmeet-kr opened this issue · 2 comments

I recently upgraded the webpack cli version from 3.3.11 to 4.10.0
When I run webpack with profiling option,
webpack --profile --json > stats.json

I get the below error:

[webpack-cli] Error: Unknown option '--profile'
[webpack-cli] Run 'webpack --help' to see available commands and options
error Command failed with exit code 2.

but from what I can see in https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md, --profile is a valid flag.
Has this flag been removed in v4?

--profile will work only if you have webpack v5.

Also you dont need to paas it with json anymore. You should update ypur command as webpack --json=stats.json

Answered, feel free to feedback