如何使用 WebStorm IDE 在我的 Meteor 应用程序中调试 CoffeeScript [英] How can I debug CoffeeScript in my Meteor app using the WebStorm IDE

查看:27
本文介绍了如何使用 WebStorm IDE 在我的 Meteor 应用程序中调试 CoffeeScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 JavaScript 使用此问题中的说明在 WebStorm 中进行 Meteor 调试(如何使用 WebStorm IDE 调试 Meteor 应用程序?).

I'm able to get Meteor debugging in WebStorm using JavaScript using the instructions in this question (How can I debug my Meteor app using the WebStorm IDE?).

但是,我似乎无法在 coffeescript 文件中设置断点.

However, I cannot seem to set breakpoints in coffeescript files.

可以这样做吗?

推荐答案

我在这个问题上摆弄了一段时间,但没有取得很大的成功.据我所知,为了让 WebStorm 支持 coffeescript 断点,它需要自己生成转译的 js 和映射文件……这会破坏流星,因为它会执行自己的咖啡脚本编译.

I fiddled with this for a while without any great success. From what I could gather, for WebStorm to support coffeescript breakpoints it needs to generate the transpiled js and map files itself... which will break meteor, as it does its own coffeescript compilation.

最后,我得到的最接近的是:

In the end, the closest I got was to:

  1. 使用节点调试器选项运行流星:

  1. Run meteor with the node debugger options:

$ NODE_OPTIONS="--debug=47977" 流星

$ NODE_OPTIONS="--debug=47977" meteor

在 Webstorm 中设置 node.js 远程调试配置,将其指向相同的端口 (47977).

Setup a node.js remote debug configuration in Webstorm, pointing it at the same port (47977).

启动调试会话

在调试器的脚本"选项卡中显示的转译 js 文件中设置我的断点.令人困惑的是,在这些文件上设置断点时,我的 WebStorm (8.0.4) 版本并没有在装订线中显示通常的红色圆圈图标......但它确实设置了断点并在那里中断.

Set my breakpoints in the transpiled js files shown in the debugger's "scripts" tab. Confusingly, when setting breakpoints on these files, my version of WebStorm (8.0.4) did not show the usual red circle icon in the gutter... but it did set the breakpoint and break there.

所以不理想,但总比没有好,比使用节点检查器更方便!

So not ideal, but still better than nothing and more convenient than using node-inspector!

这篇关于如何使用 WebStorm IDE 在我的 Meteor 应用程序中调试 CoffeeScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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