If I'm using //=require_tree .
in application.css, is there a way to exclude particular files other than resorting to //=require_directory
and tree organization?
Perhaps something like //= require_tree ., {except: 'something'}
If I'm using //=require_tree .
in application.css, is there a way to exclude particular files other than resorting to //=require_directory
and tree organization?
Perhaps something like //= require_tree ., {except: 'something'}
Try better the https://github.com/QubitProducts/miniMerge
It supports not only JS and is in basic mode sprockets compatible.
You can exclude not only on file levels but block or even lines.
Full depenedncies managment with multiple source bases.
I used sprockets in past and this one is better, I use it also for CSS.
Since the release of rails 3.2.9, it has support to lock the sprockets to version 2.2.x so that we can use the
//= stub
directive that latest sprockets have.http://weblog.rubyonrails.org/2012/11/12/ann-rails-3-2-9-has-been-released/
So, to use it, just upgrade to Rails 3.2.9
The following monkey patch solves this for me:
This is possible with Sprocket's new
stub
directive which is available in Sprockets v2.2.0 and up. However, Rails 3.2 will only ever use Sprockets v2.1.3 which does not have this feature. As of now, the current Edge Rails has thestub
directive and it will officially be in Rails 4.0 and above.Usage:
stub
directives can not be overridden by subsequentrequire
orinclude
directives.If you want to use the
stub
directive in your Rails 3.2 project you will have to switch to Edge Rails, or branch your Rails gem with its Sprockets dependency modified to version 2.2.0.NB: This answer is now out of date, with an update to Sprockets having this feature. See the answer below.
===
This is not possible with current Sprockets directives, but it seems like a handy feature.
The other way to to manually list each file you want.
Perhaps you could file this as a feature request over on the Sprockets repo? :-)