1. 程式人生 > >使用PhpStorm或WebStorm作為electron IDE

使用PhpStorm或WebStorm作為electron IDE

img 會有 ces app 打開 text ima watermark script

最近在研究electron,考慮到以前一直用PhpStorm做開發,而且electron就是基於nodejs的,因此很自然的想到要繼續用PhpStorm做IDE。

開發

打開Run/Debug Configurations窗口,添加一個Node.js配置:
技術分享圖片

然後配置Node Interpreter參數,對於windows系統,配置為項目目錄下的node_modules.bin\electron.cmd。JavaScript file參數,配置為main.js:
技術分享圖片

調試

打開Run/Debug Configurations窗口,配置Application parameters參數:
--remote-debugging-port=9222

技術分享圖片

開啟nodejs代碼輔助

未開啟nodejs代碼輔助之前,IDE內會有提示:
技術分享圖片
開啟方法:
技術分享圖片

使用PhpStorm或WebStorm作為electron IDE