I am using the CssSplitter module by CristianPeters. And I am hoping to have the split occur during the assets:precompile task and the only way I have been successful so far is to patch the Sprockets::StaticCompiler. Hoping there is a better way to do it.
I appreciate any advice
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
RAILS_ENV=production tells Rails to compile the production version of the assets. assets:precompile is a Rails provided rake task that has instructions for compiling the assets.
When confronted to this problem, I just split my manifest in 2 :
If you are writing stylesheets specifically for the IEs, it's best not to concatenate them all together. Therefore, I would have a main manifest file, where I would load all my general stylesheet files together, and 1/2/3 manifest(s) for the IE(s) using the conditional comments (http://www.quirksmode.org/css/condcom.html) :
<%= stylesheet_link_tag :application %> // main manifest
<!--[if IE 6]>
<%= stylesheet_link_tag :ie6 %> // ie6 manifest
<![endif]-->
<!--[if IE 7]> ....
in this manner I would be assured that the css loading performance wouldn't be hurt in the non-IE browsers and that my IE-specific stylesheets would not be loaded for the various versions in which they are anyways not supposed to be loaded (IE6 corrections in IE7, p.ex.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With