我应该在WebStorm中的Run Debug Configuration
中设置什么来调试create-react-native-app创建的应用程序?
我对如何调试感到茫然,因为它不使用~/.node_modules/lib/node_modules/react-native-cli
而是使用一个名为react-native-scripts
的自定义模块来开始编译:
的package.json:
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch",
"menu": "adb shell input keyevent 82"
},
我不认为你能做到这一点,至少不是一个简单的方法,为什么你还想做呢?
React Native通过Chrome开发者工具“开箱即用”,具有出色的调试功能。在这里,您可以调试在仿真器上运行的代码,甚至可以在真实设备上运行。详情请见:https://facebook.github.io/react-native/docs/debugging.html
您必须使用Webstorm / Intellij 2018.1(目前通过EAP)
https://youtrack.jetbrains.com/issue/WEB-26951 https://blog.jetbrains.com/webstorm/2018/02/webstorm-2018-1-eap-181-3263/#debugging-expo