I’m not quite sure what the actual behavior is, so my first question is:
Are assets (e.g. javascripts) from a gem (in my case Spree) always compiled? I don’t use Spree’s javascripts, and therefore don’t want them to be compiled. I don’t require them in my application.js or any other javascript file, but
rake assets:precompile
compiles them nonetheless. I just don’t want them lying around in my public/assets folder.
So I guess my question is, is there a way to disable compiling javascripts from a gem?
I guess there is a smart way to achieve your goal using
sprockets. Maybe somerequire_directoryinstead ofrequire_tree.But the most direct thing would be to remove theses assets from your assets paths. To achieve this, add this at the very end of your
application.rbfile (doesn’t work in an initializer):Just tried a hack: put the code in an
initializerbut require it at the end of yourapplication.rb:I prefer very specific code to be visible this way.