使用sublime text 2和3調試node-webkit

下面由sublime使用教程欄目給大家介紹sublime text 2和3調試node-webkit的方法,希望對需要的朋友有所幫助!

使用sublime text 2和3調試node-webkit

sublime text 2是非常優秀的跨平臺編輯器用于開發node-webkit應用。

Mac OS X

1.下載node-webkit.app并放在/Application文件夾內

2.從sublime text 2菜單選擇Tools -> Build System -> New Build System

3.輸入以下代碼:

{ ????"cmd":?["node-webkit",?"--enable-logging",?"${project_path:${file_path}}"], ????"working_dir":?"${project_path:${file_path}}", ????"path":?"/Applications/node-webkit.app/Contents/MacOS/" }

1.使用sublime text 2的File -> New Window打開一個新的窗口

2.使用Project -> Add Folder to Project添加一個工程到當前窗口中

3.從左側的菜單中打開你的主應用程序文件(例如:index.html)然后選擇Tools -> Build

4.此時node-webkit應用程序將會啟動你的項目并且可以在sublime text2中看到調試輸出

在sublime text3中使用方法一樣。

Windows

同上面一樣,不同的是建立系統的命令,如下所示(替換掉nw.exe的實際路徑):

{ ????"cmd":?["nw.exe",?"--enable-logging",?"${project_path:${file_path}}"], ????"working_dir":?"${project_path:${file_path}}", ????"path":?"C:/Tools/node-webkit/", ????"shell":?true }

以上就是使用

? 版權聲明
THE END
喜歡就支持一下吧
點贊5 分享