-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Debugging with Sublime Text 2 and 3
Sublime Text 2 is a great cross-platform editor for building node-webkit apps, you can download it here: http://www.sublimetext.com/2
-
Download node-webkit.app and place it in /Applications folder
-
From the Sublime Text 2 menu select
Tools -> Build System -> New Build System
-
Enter the following code:
{ "cmd": ["nwjs", "--enable-logging", "${project_path:${file_path}}"], "working_dir": "${project_path:${file_path}}", "path": "/Applications/nwjs.app/Contents/MacOS/" }
-
Save the configuration as
nodeWebKit.sublime-build
on the suggested folder -
Open a new window in Sublime Text 2 using
File -> New Window
-
Add your project to the window using
Project -> Add Folder to Project...
-
Open your main application file (ex.: index.html) from the left side menu
-
Select
Tools -> Build System -> nodeWebKit
(required step just for Sublime Text 3) -
Select
Tools -> Build
-
At this point node-webkit application will launch with your project and you will be able to see the debugging output in Sublime Text 2
Work the same with Sublime Text 3, just notice step 8
As above, but the commands for the build system are as follows (replacing the path with the location of nw.exe):
{
"cmd": ["nwjs.exe", "--enable-logging", "${project_path:${file_path}}"],
"working_dir": "${project_path:${file_path}}",
"path": "C:/Tools/nwjs/",
"shell": true
}