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

Moving babel config to .babelrc from package.json #425

Closed
crobinson42 opened this issue Dec 10, 2016 · 1 comment
Closed

Moving babel config to .babelrc from package.json #425

crobinson42 opened this issue Dec 10, 2016 · 1 comment
Assignees

Comments

@crobinson42
Copy link
Member

In a unique case with react-native projects where babel is customized and stripped for performance reasons - js-data's package.json babel config breaks the build.

Replicate this by creating a simple react-native project and including js-data:

react-native init DemoApp && cd DemoApp && npm i js-data@rc

Now, edit the index.ios.js or index.android.js file to include import { Container } from 'js-data' then save and run the simulater

react-native run-ios

You'll see an error babelHelpers.typeof is not a function this is because babel is stripped down and customized in react-native using preset "react-native". Now, to show how this can be fixed, remove or move the babel config in the node_modules/js-data/package.json file to .babelrc and restart the simulator with --reset-cache

react-native run-ios --reset-cache

And the error has gone away!

Any objections to moving these babel configs from package.json?

@jmdobry
Copy link
Member

jmdobry commented Dec 12, 2016

We probably can, but I'll have to verify

@jmdobry jmdobry self-assigned this Dec 12, 2016
jmdobry added a commit that referenced this issue Jan 18, 2017
jmdobry added a commit that referenced this issue Jan 18, 2017
@jmdobry jmdobry added done and removed in progress labels Jan 29, 2017
@jmdobry jmdobry closed this as completed Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants