-
Notifications
You must be signed in to change notification settings - Fork 29
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
Strict mode - Detect duplicate UglifyPlugin #71
Comments
Good idea. I think it'd be great if there were a way for Webpack to prevent this from happening at all. Double minification is probably never desirable... |
Speaking of minification, I have seen cases where people apply minification on already minified files. Usually that ends up in weirdness (not terminating builds!). That's one thing, but probably hard to detect. |
I actually spoke with @kentcdodds about this. I ran into this issue while analyzing the build time of a few applications that I was working with. I found out that Note: I had to also put I think the problem is that the validator can't detect the whether the user is using Adding a note to not use |
Good point about Ideally we should be able to use the rules of webpack itself. We could perhaps do that by using |
Shouldn't we be able to get the args from |
If you invoke the validator inside configuration, that would work. If we go through the CLI (#87), it will need a little different kind of handling as then we are looking at it from the outside (package.json |
Good point. Something's better than nothing though. But if we can handle it for both cases that's be great. Honestly, this seems like something Webpack should warn about by itself... |
Absolutely. We are just putting some bandaid on it. ;) The implementation doesn't look too bad. Both cases are fairly straight-forward to handle because we can piggyback on webpack's own logic here. |
Yep, sounds reasonable. More brittle script parsing, but I guess PRs to webpack itself aren't very likely to get through, or am I wrong? |
I'm not so sure. We can definitely build an awesome prototype here and then negotiate. These kind of things are fairly simple in user space. My thinking is that webpack core should drop all the flag stuff (less to maintain) but that's another discussion. 👍 |
Just saw a case where a user was using
-p
andUglifyPlugin
separately. Latter was used to setcompress['drop_console']
. The problem is that this will lead to double minification and it won't work as you might expect.It would be good to be able to detect this case. Perhaps the same applies to some other plugins as well, but this would be a nice starting point.
The text was updated successfully, but these errors were encountered: