首页  >  文章  >  开发工具  >  使用sublime text 2和3调试node-webkit

使用sublime text 2和3调试node-webkit

藏色散人
藏色散人转载
2019-10-02 14:34:222766浏览

下面由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
}

以上是使用sublime text 2和3调试node-webkit的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:segmentfault.com。如有侵权,请联系admin@php.cn删除