简体   繁体   English

用 react+babel 调试 vscode

[英]vscode debugging with react+babel

I have a project which these scripts:我有一个项目,这些脚本:

  • "dev": "babel-node --presets 'react,es2015' src/server.js" "dev": "babel-node --presets 'react,es2015' src/server.js"
  • "start": "NODE_ENV=development babel-node --presets 'react,es2015' src/server.js" "start": "NODE_ENV=development babel-node --presets 'react,es2015' src/server.js"
  • "build": "NODE_ENV=development webpack -p" “构建”:“NODE_ENV=开发 webpack -p”

I want to know how launch.json should be wrote to debug with VScode.我想知道应该如何编写launch.json 以使用VScode 进行调试。

You can use debugger;您可以使用debugger; statement, you can set it in your code and when you will run the app, automatically will get in a debug mode on the Browser.声明,你可以在你的代码中设置它,当你运行应用程序时,浏览器会自动进入调试模式。

Please read about debugger statement on the link below https://www.w3schools.com/jsref/jsref_debugger.asp请阅读以下链接上的调试器声明https://www.w3schools.com/jsref/jsref_debugger.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM