4

In webpack 4 I was using --display-modules option of webpack-cli. I can also see it in the documentation. moving to webpack 5, my build started to fail with below error:

[webpack-cli] Error: Unknown option '--display-modules'
[webpack-cli] Run 'webpack --help' to see available commands and options

After checking webpack 5 documentation I saw that the option was removed but I did not see anything about it in the breaking changes between the versions.

Is there an alternative?

Noy Oliel
  • 1,430
  • 3
  • 13
  • 26

1 Answers1

0

For Webpack 5, use stats.modules (https://webpack.js.org/configuration/stats/#statsmodules) - it tells stats whether to add information about the built modules:

module.exports = {
  //...
  stats: {
    modules: true,
  },
};
KimchiMan
  • 4,836
  • 6
  • 35
  • 41