ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
976 stars 78 forks source link

Not compatible with browserify-rails #113

Open CGamesPlay opened 8 years ago

CGamesPlay commented 8 years ago

This library is incompatible with browserify-rails, because dependency modifications do not invalidate the cache.

I'm able to get turbo-sprockets-rails3 to ignore browserify-rails by dropping this line in an initializer, but this has the drawback of removing all benefit from using turbo-sprockets-rails3.

Rails.application.assets.register_preprocessor('application/javascript', BrowserifyRails::BrowserifyProcessor)

It looks like this was encountered with Sass/Less in the past, judging by the comments in lib/sprockets/unprocessed_asset.rb. I think the root problem is that turbo-sprockets-rails3 doesn't cache the list of dependencies, so it can't know when they change.