-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Terser plugin set to 2020, thus shortening using nullish coalescing operator despite browserslist #17620
Comments
To anyone coming here in the future, if you want to target anything between es2015 and es2020, the above fix would require you to target es2015 by adding IE 11 in your browserslist config. This is only any issue though if the minified code outputs es2020 which, at first glance, appears uncommon. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Including code that Terser can shorten using
??
syntax will be shortened thus due to the choice ofecma
value2020
in the TerserPlugin options in the@nx/webpack
package. This is despite any.browserslistrc
configuration we choose.Expected Behavior
I would expect to be able to build projects without the nullish coalescing operator in my build output. Preferably there would be some way to adjust the plugin options to the TerserPlugin. Or maybe a different/older value chosen based on Nrwl's chosen level of support. I see that you've officially stopped supporting IE11, so something like es2015 or es2016.
GitHub Repo
https://github.com/kevinbeal/nx-examples
Steps to Reproduce
??
by terser, like so:optimization
flag turned on so that TerserPlugin is used.Nx Report
Failure Logs
No response
Operating System
Additional Information
A custom webpack config can be used to overwrite the
ecma
value, like so:Not that I would recommend this.
The text was updated successfully, but these errors were encountered: