Why we need to create source maps
What are minification and asset combining?
But why do I need source maps?
What things will I need to set this up?
Here is a list of things you should have ready to set up to implement source maps with your application:
- The ability to install the UglifyJS2 NPM package on your local machine or production environment.
Setting up source maps with Rails 4/5
Note: while Sprockets 4 is rumored to support source maps fully, version 3 (currently used by Rails 4/5) does not.
//= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require turbolinks //= require bootstrap/dropdown //= require_tree .
So we have our minified/combined files and our source map. One of the major benefits of usign Raygun in this way is that you don’t have to setup/create your own error tracking for both your Rails and JS app. Then you can view both apps in one location. You’ll need your Ruby on Rails application connected to Raygun before you start. (You can take a free 14 day trial here – it doesn’t take a moment to get set up.)
- Once you are logged into Raygun, click on the ‘+’** **symbol in the upper left corner of your browser window:
- Click on ‘Create Crash Reporting application:’
- Enter in a name for your application and then click the ‘Next’ button:
Share you feedback and suggestions on source maps in the comments below…