从Webstorm咕噜调试 [英] Grunt debugging from Webstorm

查看:141
本文介绍了从Webstorm咕噜调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以通过外部工具在网络风暴中运行grunt任务。但是,是否可以使用外部工具来调试?通过在网络风暴中运行grunt server或grunt test这样的任务,如果可以使用外部工具(如grunt),则可以使调试更容易。

Its possible to run grunt tasks within webstorm through external tools. However, is it possible to avail debugging with external tools? By running tasks like 'grunt server' or 'grunt test' within webstorm, it would make debugging a lot easier if it's possible with external tools like grunt.

推荐答案

您必须运行 grunt-cli 作为Node应用程序:

You have to run grunt-cli as a Node application:


  • 创建一个新的Node.js运行/调试配置:运行 - >编辑配置...

  • 节点路径中选择您的节点二进制,即: /Users/someuser/nvm/v0.10.5/bin/node

  • 工作目录,选择您的 Gruntfile.js 目录,即 / Projects / someproject

  • 节点应用程序JS文件的路径中,选择您的Grunt CLI路径(您可以选择在节点bin目录中创建的 grunt-cli 符号链接, WebStorm将使用符号链接目标),即: /Users/someuser/nvm/v0.10.5/lib/node_modules/grunt-cli/bin/grunt
    C:\Users\some在Windows 7上的用户\AppData \Roaming\\\
    pm\\\
    ode_modules\grunt-cli\bin\grunt

  • 应用程序参数输入要运行的Grunt任务,即 test

  • Create a new Node.js Run/Debug configuration: Run->Edit configurations...
  • In Path to Node choose your node binary, ie: /Users/someuser/nvm/v0.10.5/bin/node
  • In Working Directory, choose your Gruntfile.js directory, ie /Projects/someproject
  • In Path to Node App JS File, choose your Grunt CLI path (you can choose the grunt-cli symlink created on your node bin directory, WebStorm will use the symlink target), ie: /Users/someuser/nvm/v0.10.5/lib/node_modules/grunt-cli/bin/grunt (C:\Users\someuser\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt on Windows 7)
  • In Application parameters enter the Grunt task to run, ie test

点击运行或调试,你完成了:)

Click on Run or Debug and you are done :)

这篇关于从Webstorm咕噜调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆