I am facing an issue with a large rails application that has hundreds of coffee script files.
Whenever I make a small change in a coffee script file or switch branches, the entire assets need to be precompiled, causing a significant delay in loading the page:
Started GET "/assets/application.js" for 127.0.0.1 at 2013-01-11 19:39:45 +0100
Compiled sprockets/commonjs.js (0ms) (pid 18142)
Compiled jquery.js (2ms) (pid 18142)
Compiled jquery_ujs.js (0ms) (pid 18142)
Compiled underscore.js (0ms) (pid 18142)
Compiled backbone.js (0ms) (pid 18142)
Compiled backbone_rails_sync.js (0ms) (pid 18142)
Compiled handlebars.runtime.js (0ms) (pid 18142)
Compiled moment.js (0ms) (pid 18142)
...and so forth
The assets configuration I am using is located in config/development.rb
:
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = false
Setting config.assets.debug = false
results in a long wait time for loading hundreds of js files. My question is, how can I strike a balance? How can I optimize the assets configuration for the development mode of this large application?