-
Notifications
You must be signed in to change notification settings - Fork 362
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
v4 not compatible with create-react-app #261
Comments
The code is already bundled using webpack, see the |
I don't know if I understand you correctly. The issue is not that the code is bundled using webpack. The issue is that the code is using es6. And that create-react-app uglifies all imported code. And that this only works with es5 code, causing above error if the code is es6. The issue is also that older browsers will fail to understand es6 code. That is the reason why create-react-app expects libraries to use es5. It should not be too hard to compile this library es6 code back to es5 as you seem to be using webpack. |
I'm currently working on this. |
I am using create-react-app (https://github.com/facebook/create-react-app).
After updating to v4 (which worked fine in dev mode) production build fails:
create-react-app explains the issue here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
It seems like the breaking part is uglify, see here: facebook/create-react-app#984 (comment)
So the reason for my (and likely lots of other people's) build breaking is that json2csv does not compile to es5.
I do realize that it is nice to code using es6 - I do it myself. But can you please compile it to es5 as long as this prevents usage in most browser use cases?
The text was updated successfully, but these errors were encountered: