使用节点检查器与Grunt任务 [英] Using node-inspector with Grunt tasks
问题描述
有人使用节点检查器与 Grunt 进行应用程序调试?如果没有,你可以推荐一个基于Grunt的应用程序的调试工具吗?
我正在使用 nodejs 服务器端应用程序,我有 Grunt 使用分离的任务(这是因为用户可以单独执行任务。)
提前感谢
要在调试中运行grunt,您需要将grunt脚本显式传递给节点:
node-debug $(which grunt)任务
并放置一个调试器;
在你的任务中。 node-inspector
然后打开一个带有调试工具的浏览器。
编辑2014年2月28日
node-inspector
添加了命令 node-debug
一个 - debug
状态,并将浏览器打开到节点检查器
页面,当它访问第一个 debugger
行或设置断点。
编辑2015年1月30日
Does someone used node-inspector with Grunt for application debugging? If not, Can you recommend a debugging tool for Grunt based apps?
I'm working with nodejs for a server side app and I have Grunt to use separated tasks (this is because users can execute tasks separately).
Thanks in advance
To run grunt in debug, you need to pass the grunt script to node explicitly:
node-debug $(which grunt) task
and put a debugger;
line in your task. node-inspector
will then open a browser with debugging tools.
Edit 28 Feb 2014
node-inspector
has added the command node-debug
, which launches node in a --debug
state and opens the browser to the node-inspector
page, stopping when it hits the first debugger
line or set breakpoint.
Edit 30 January 2015
On Windows, things are a touch more complicated. See the answer from @e.gluhotorenko for instructions.
这篇关于使用节点检查器与Grunt任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!