Skip to content
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

使用包含hooks API的react版本时,生产环境版本压缩代码后报错 #63

Open
Chaoming-L opened this issue Mar 6, 2019 · 0 comments

Comments

@Chaoming-L
Copy link

Chaoming-L commented Mar 6, 2019

🍉what?

使用react^16.8.4 版本的hooks api, 压缩打包生产环境代码. 报错!
如图:
image

📦why?

webpack官方的issue
发现问题是 uglifyjs-webpack-plugin 的bug导致, 具体情况如下:
mishoo/UglifyJS#3291

🔑how to fix?

官方建议切到terser plugin (https://github.com/webpack-contrib/terser-webpack-plugin), 解决问题.
image

🚀orther

为什么选择terser?
terser官方解释: uglify-js 不支持ES6+, uglify-es也不再维护.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant