-
-
Notifications
You must be signed in to change notification settings - Fork 384
feat: add orderWarnings flag #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add orderWarnings flag #366
Conversation
The flag defaults to true, which retains the existing behaviour of warnings when there is conflicting import order between multiple CSS files. When set to false, these warnings are not generated.
503dec2
to
9c1c9b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need option for this, warning in this case is good, other developers should know what order is invalid
|
I can make a minimum repo of this problem but I don't think it will help. I think its good for a project to disallow warnings (e.g. in production, the master branch, etc). That way warnings are useful in development. If there's heaps of warnings all the time, nobody reads them or notices new ones and they are not useful. Sometimes that means making a compromise - some warnings are too hard to fix and the fix doesn't provide enough benefit. It's better to hide them than to have heaps of warnings that nobody reads. All this change does is provide an (optional, non-default) way of turning the warning off in a simpler and cleaner way than filtering strings with regexes. |
No it is bad DX. You may miss a problem when you actually have to solve it. |
Then why are you recommending to use
In projects that do that, it doesn't matter what order CSS is imported, and the warning is wasting their time. Having the warning on by default is fine, I can see that it is a potential problem people should be aware of. But not letting them turn it off in a clean way seems counter productive. |
Should this PR be updated with |
PR welcome |
Closing in favour of #422 |
The flag defaults to true, which retains the existing behaviour of
warnings when there is conflicting import order between multiple CSS
files. When set to false, these warnings are not generated.
This PR contains a:
Motivation / Use-Case
As has been pointed out in #250:
stats.warningFilter
as recommended by @sokra in New version 0.4.2 capture lot of warnings #250 (comment) or webpack-filter-warnings-plugin does not work consistently. It's much better to avoid generating the warnings at their source (optionally) rather than to partially filter them later with regexes. For example, I use webpack-error-on-warnings-plugin to enforce that there are no warnings in a build. This is incompatible with filtering warnings, because it the error must happen in thebefore-emit
hook so that it prevents emission of assets when there are warnings. The warnings filtering happens in thedone
hook or in thetoJson
method, which is too late.