WebStorm debugging create-react-native-app

人走茶凉 提交于 2019-12-10 18:21:20

问题


What should I set in Run Debug Configuration in WebStorm to debug a app created by create-react-native-app?

I'm at a loss on how to debug since it doesn't use ~/.node_modules/lib/node_modules/react-native-cli but a custom module called react-native-scripts to start the compiling:

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"
  },

回答1:


I dont think you can do this, at least not in an easy way, and why would you wan't to do it anyway?

React Native ships with great debugging capabilities "out of the box" via Chrome Developer Tools. Here you can debug code, both running on emulators, and even better on a real device. See here for details: https://facebook.github.io/react-native/docs/debugging.html




回答2:


You have to use Webstorm/Intellij 2018.1 (through EAP at the moment)

https://youtrack.jetbrains.com/issue/WEB-26951 https://blog.jetbrains.com/webstorm/2018/02/webstorm-2018-1-eap-181-3263/#debugging-expo



来源:https://stackoverflow.com/questions/43996660/webstorm-debugging-create-react-native-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!