Reputation: 11
I am attempting to integrate a module that uses es6 features such as arrow syntax with a react native project. Unfortunately react native doesn't seem to compile any code in the node_modules directory. I've experimented with the only
and the ignore
options in the .babelrc
file but to no avail, it still outputs untranspiled es6 code from the node_modules folders and causes errors when it's ran on android. Is it possible and if so what is the best way of whitelising particular modules to transpile from the node_modules folder?
Upvotes: 0
Views: 659
Reputation: 11
It turns out that react native does transpile the code from the node_modules folder. The issue was actually related to a bug in a custom plugin that is included with the babel-react-native preset. The bug report is here: https://github.com/facebook/react-native/issues/19511
Upvotes: 1