How can I get the Rails asset pipeline to produce source maps?

Vincent Woo picture Vincent Woo · Jan 30, 2013 · Viewed 11.7k times · Source

I'd like to have Rails produce source maps alongside the compiled coffeescript/minified JS, for better error logging. There doesn't seem to be comprehensive documentation on the net on how to do this, yet, though. Has anyone done this?

I'm on Rails 3.2 and Heroku.

Answer

jsanders picture jsanders · Jan 8, 2014

Rails supports source maps for minified JavaScript! Rails relies on Sprockets for asset compilation, and source maps support was added to Sprockets in this pull request.