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

sublime text 2是很是優秀的跨平臺編輯器用於開發node-webkit應用。html

Mac OS X

1.下載node-webkit.app並放在/Application文件夾內
2.從sublime text 2菜單選擇Tools -> Build System -> New Build System
3.輸入如下代碼:node

{
    "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中看到調試輸出web

在sublime text3中使用方法同樣。shell

Windows

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

{
    "cmd": ["nw.exe", "--enable-logging", "${project_path:${file_path}}"],
    "working_dir": "${project_path:${file_path}}",
    "path": "C:/Tools/node-webkit/",
    "shell": true
}
相關文章
相關標籤/搜索