My goal is to run ES6 JavaScript code containing console.log statements on the command line to help debug code before integrating with my React Native app. This code contains only JS functions.
This is what I tried:
Install babel-cli
npm install --save-dev babel-cli
File: .babelrc ( in project root )
{
"presets": ["react-native"]
}
Run sandbox:
./node_modules/.bin/babel-node app/components/sandbox.js
I get the following run-time error:
/react-native/myapp/source/node_modules/react-native/Libraries/react-native/react-native.js:15
if (__DEV__) {
^
ReferenceError: __DEV__ is not defined
I had this working once.
What am I missing?