mini-css-extract-plugin: Output logging is too verbose and can't be disabled or minimized
After enabling this plugin on our project, our webpack build now spits out hundreds of pages of mini-css-extract-plugin
output, none of which is particularly helpful or informative. I see thousands of lines like this:
Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/postcss-loader/src/index.js??ref--11-2!node_modules/less-loader/dist/cjs.js??ref--11-3!webpack/color-sharing-loader.js!<redacted>:
Entrypoint mini-css-extract-plugin = *
2 modules
Is there a way to disable or minimize all these messages? Our CI logs are now full of them and all this extra noise makes legitimate errors harder to find.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (5 by maintainers)
This is not a good solution. I tried this out locally and I noticed that some very helpful webpack output is now being suppressed (specifically, the display of assets, file sizes, and chunks).
The correct solution, which someone else mentioned already (in the other issue), is that the messages from this plugin should be logged at the
verbose
level. That way, they’re suppressed during normal operation, but users can view them if they really want to. I’m pretty sure that will solve the issue here and make everyone happy.Thanks, I believe so, though in this case webpack-dev-middleware is involved (via koa-webpack) so I’m trying
app.use(middleware, { devMiddleware: { stats: { children: false } } })
in place of this line, and still no change 🤷That other thread did make a good case for why
children: false
isn’t a great long-term solution, so hopefully the “simplified output” with webpack@5 will be enough until I can track this down. Thanks again for taking a look!FWIW, we’ve adopted this config in our project and it’s worked out well:
It suppresses all the annoying CSS messages, but we can still see the output of assets.