question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strict mode - Detect duplicate UglifyPlugin

See original GitHub issue

Just saw a case where a user was using -p and UglifyPlugin separately. Latter was used to set compress['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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bebrawcommented, May 10, 2016

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.

0reactions
bebrawcommented, May 10, 2016

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. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack generated broken code in production mode #307
Disable the uglify-es compress inline option as a workaround. Fixed by the use of terser in #296.
Read more >
Google Closure using ES5 strict mode even though I specified ...
How do I overcome "object literals cannot contain duplicate keys in ES5 strict mode" error with Maven minify plugin? Related. 1 · Best...
Read more >
Optimization - webpack
Tells webpack to merge chunks which contain the same modules. Setting optimization.mergeDuplicateChunks to false will disable this optimization. webpack.config.
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
Instead, the plugin works with the R8 compiler to handle the following compile-time tasks: Code shrinking (or tree-shaking): detects and safely removes unused ......
Read more >
terser - npm
terser is a fork of uglify-es that mostly retains API and CLI compatibility with ... Strict mode is implied and the toplevel option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found