1

For the most part, my app has good loading times in development. The only problem that I am experiencing is that whenever I make any changes to my coffeescript file, the page load times take 40 to 60 seconds to load. After the first load, they work just fine, but when you are trying to fix a bug or build a new feature, it is impossible to work with those load times. I have tried several fixes: i.e. Slow assets compilation in development mode or the rails-dev-tweaks gem.

None of them work. I have a lot of different javascript and coffeescript files that I am loading from, but none of them work. Is there any way around this? How can you code in coffee script in Rails without these really long load times?

Community
  • 1
  • 1
jah.humes
  • 565
  • 4
  • 9

1 Answers1

3

I was having the same problem for both SASS and Coffeescript compiling. My problem with slow SASS compiling was fixed by setting

config.assets.debug = true

But there was not much about the solution for Coffeescript there. Staring over from assets/Sprockets settings, I found the js_compressor config in my config/application.rb:

config.assets.js_compressor = :uglifier

By removing it, my problem was solved and changes to my coffeescript files are loaded really fast again.

user2110836
  • 164
  • 1
  • 4
  • Thanks! I made one quick adjustment to this to make it still minify in production. I added `config.assets.js_compressor = false` to `config/environments/development.rb`. This allows the coffeescript to be loaded quickly, but doesn't mess with the default configuration of the website. – jah.humes Apr 29 '14 at 14:56
  • @user2110836 shouldn't this be `config.assets.debug = false` instead? – christianvuerings Oct 16 '14 at 14:13