I have a large rails app with hundreds of coffee script files.
Sometimes when I make a tiny change in a coffeescript file or I switch the branch the whole assets are
As others have pointed out, optimizing your assets is the #1 way to increase compilation speed (eliminate unnecessary files and pre-processors, import carefully, and use partials with caution). However, why are you turning config.assets.debug = false
in development mode anyway? When it's false, sprockets will concatenate all your files together, and this can take quite a while if you have a large number of files.
Instead, turn config.assets.debug = true
, so assets are compiled and cached on the first request. Sprockets sets a Cache-Control HTTP header to reduce request overhead on subsequent requests. The browser gets a 304 (Not Modified) response. See the Rails Asset Pipeline documentation.
Take a look at this middleware from the Discourse team. We've had great success with it in our rails 4 app -- took reload times down from a minute to 5 seconds in development.
It's a sad truth, but you don't. There is not a clean way to solve this.
However, there are some patterns you could follow to minimize your pain which if I understand correctly is having to wait a lot in development to see the changes.
As said these have been seen here1 and here2.