我最近为Visual Studio安装了NodeJS Tools,它支持VS中的Node环境.值得注意的是,它能够从IDE设置调试断点.
我不清楚在调试Gulp任务时是否可以设置断点.Task Runner能够检测Gulp任务并将console.log语句输出到窗口,但我还没有找到更好的调试方法.
我在一段时间后发现了这篇文章:如何在使用Visual Studio Task Runner Explorer运行时调试gulpfile.js?但是,这篇文章不涉及NodeJS Tools for VS. 所以,我正在重新提出问题以考虑该插件.
node-inspector为了能够调试,执行的正确方法是什么gulpfile.js?
我试过跟随(我的gulpfile中的代码需要harmony和harmony-arrow-functions switches):
node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default
Run Code Online (Sandbox Code Playgroud)
节点检查器已正确加载,但是无法在加载文件之前或之后在gulpfile中设置断点.它也不可能设置断点gulp/index.js和orchestrator/index.js文件.并且不可能"进入"以下声明(整个来源):
gulpInst.start.apply(gulpInst, toRun);
Run Code Online (Sandbox Code Playgroud)
环境: