The first thing you need to do is have r.js
generate a source map of the bundle. To do this, in the options you pass to r.js
you need to have the option generateSourceMaps
set to true and you must set the optimize
option to "uglify2"
or
"closure" with a closure compiler jar build after r1592 (20111114 release)."
(I'm citing from this documentation.) I've done it with optimize set to "uglify2"
and was able to get decent references to the original source code in Chrome.
The logging service must also support it. This post over at the raygun forums suggests that raygun does not yet support source maps.
Someone created a list of such services as a gist over at github. Some of the services are marked as supporting source maps. I can't vouch for its accuracy but it could be a good starting point to find a service that supports it.