I am working on a Rails application using the Asset pipeline. Development.rb has the following:
config.assets.compress = false config.assets.compile = true config.assets.debug = true
In Dev, resources are not combined, and each of them is serviced by Rails individually. At the moment, the number of assets that are received individually is more than 50. Therefore, a complete page reload is very slow.
I would like to combine them in at least several assets for faster loading times in the development environment, but, nevertheless, I lose the ability to debug / see them separately in Chrome dev tools. Example: http://d.pr/i/ZFge
There are two ways to solve this, as far as I know, after this:
config.assets.debug = false
and start serving them as concatenated assets.
- Old hacker way: @sourceUrl trick.
- New way: sourceMaps .
Is there a guide on how I can enable them in a rails application? I do not use CoffeeScript, so https://github.com/markbates/coffee-rails-source-maps does not help. Most Google searches lead to this.
I am looking for a solution for native JS.
javascript ruby-on-rails ruby-on-rails-3 source-maps
Rajat
source share