user1547174 user1547174 - 6 months ago 55
CoffeeScript Question

Locate coffeescript line

I am taking over a legacy app that uses coffeescript. The compiled javascript shows several AJAX requests. However, I cannot locate where they are defined in the coffeescript. Does anyone know of a way I can locate the coffeescript lines that generate corresponding javascript lines?

Thanks in advance!


First you need to generate source maps when compiling the coffeescript. You can do that by passing -m to the compiler.

The second thing you need to do, is to set break points to xhr calls. In Chrome you can find that option in the Sources tab, in the right panel, there is an option called XHR Breakpoints.

Once the XHR is fired, the browser is going to show the line of coffesscript that made the request.