Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

disable reduce_vars in uglify-es due to bug in code generation #4692

Closed
xaviergonz opened this issue Jun 27, 2018 · 4 comments
Closed

disable reduce_vars in uglify-es due to bug in code generation #4692

xaviergonz opened this issue Jun 27, 2018 · 4 comments

Comments

@xaviergonz
Copy link

Is this a bug report?

yes

Did you try recovering your dependencies?

yarn 1.7.0

Which terms did you search for in User Guide?

N/A

Environment

Environment:
OS: Windows 10
Node: 10.5.0
Yarn: 1.7.0
npm: 6.1.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found

Description

Basically, in uglify-es, the reduce_vars (set to true by default) sometimes generates bad code as seen in mishoo/UglifyJS#3122

Although it seems to be fixed (to be released in an hypothetical uglify-es 3.3.10), today I found out that actually uglify-es is no longer mantained (see mishoo/UglifyJS#3156), so my recommendation in the time being is to add reduce_vars: false in the compress section of the UglifyJSPlugin for the time being so nobody else finds this problem.

@xaviergonz
Copy link
Author

Just created a pull request for it

@xaviergonz
Copy link
Author

Another option to consider is to switch to https://github.com/fabiosantoscode/terser
which is a fork of uglify-es by two of the main mantainers, but mantained.

@xaviergonz
Copy link
Author

@Timer
Copy link
Contributor

Timer commented Sep 18, 2018

We've switched to terser. Closing.

@Timer Timer closed this as completed Sep 18, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants