Skip to content

Commit

Permalink
docs: add Babel example with env setting from CRNA (callstack#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpme authored and eriveltonelias committed Sep 21, 2018
1 parent 32940d3 commit 45e5392
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/pages/2.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ To get smaller bundle size by excluding modules you don't use, you can use our o
}
```

If you created your project using CRNA or Expo, you'll have an `env` section. You can create a new `production` key and place it below so it looks like this:

```json
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
},
"production": {
"plugins": ["react-native-paper/babel"]
}
}
}
```

**Note:** The plugin only works if you are importing the library using ES2015 import statements and not with `require`.

## Usage
Expand Down

0 comments on commit 45e5392

Please sign in to comment.