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

Switch Babel preset on eject #328

Merged
merged 1 commit into from
Jul 27, 2017
Merged

Conversation

fson
Copy link
Contributor

@fson fson commented Jul 26, 2017

  • Switch from babel-preset-expo to babel-preset-react-native-stage-0 when ejecting.
  • Automatically install the babel-preset-react-native-stage-0 package.
  • Also prune removed packages when ejecting. (I got the idea from this from @dikaiosune's comment here: Make the CLI recognize CRNA projects facebook/react-native#15139 (comment)). This way the node_modules folder will be in a consistent state after eject. This is done by simply removing the node_modules folder. (I tried just running yarn, which should ensure consistent state and also npm uninstall <package> when using npm, but both had issues.)

Test plan

  • Create an app. Eject the app.
  • Create an app. Remove yarn.lock (forces npm to be used). Eject the app.
    • In both cases, after eject, the app starts, .babelrc has the babel-preset-react-native-stage-0/decorator-support preset and the preset is installed. expo is not found in node_modules.
  • Create an app. Replace the preset in .babelrc with react-native. Eject.
    • The preset is not changed and babel-preset-react-native-stage-0 not installed.

* Switch from `babel-preset-expo` to `babel-preset-react-native-stage-0`
  when ejecting.
* Automatically install the `babel-preset-react-native-stage-0` package.
* Also prune removed packages when ejecting.
@fson fson requested a review from brentvatne July 26, 2017 16:58
@brentvatne
Copy link
Member

❤️ again

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

Successfully merging this pull request may close these issues.

2 participants