2017-02-26 84 views
2

中使用,因爲我工作了半小時以上的電子快速入門教程。像文檔告訴我,我創造了這樣的filestructure:電子 - 斷點只能在main.js中使用,但不能在index.js

  • 的package.json
  • main.js
  • 的index.html

從我做就推出改變文檔出發以.json使F5上我的項目開始在Visual Studio代碼:

 "type": "node", 
     "request": "launch", 
     "name": "Programm starten", 
     "program": "${workspaceRoot}/main.js", 
     "cwd": "${workspaceRoot}", 
     "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", 
     "runtimeArgs": [ 
      "--enable-logging" 
     ] 

我oncklick() - 函數在index.js,這爲r eferenced index.html中:

<script src="index.js"></script> 

這一切都很好,但我怎樣才能讓我的index.js的斷點內VSC工作? Main.js-breakpoints應該停止。

THX piccus

回答

2

可你改變launch.json像這樣的檢查這個文件 http://electron.rocks/debugging-electron-in-vs-code-revised/

{ 
    "name": "Debug", 
    "type": "chrome", 
    "request": "launch", 
    "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", 
    "runtimeArgs": [ 
     "${workspaceRoot}", 
     "--enable-logging", 
     "--remote-debugging-port=9222" 
    ], 
    "sourceMaps": false 
} 

順便說一句,如果它不是一個錯字,你可以改變你的oncKlick功能的onclick()

相關問題