asset pipeline slight rethink?

The default setting for config.assets.precompile returns true (so the asset will be precompiled) on any files *not* ending with .js and .css with the exception of application.css and application.js (which do get precompiled).

But my stylesheet files (to pick an example) end with .css.scss and are included via @import statements by sass. I have not played with coffee script but I would assume people that have files like foo.js.coffee also include them into application.js. I thought the objective is to have one big .js file and one big .css file.

It is not hard to change. In production.rb, instead of appending to config.assets.precompile, a user can just assign to it. That scares me a little. And, I suppose having precompiled assets that are never used is not a bad thing. Except in my case it was.

When xyz.css.scss was precompiled (by itself), it failed because it assumed that other scss files had already been included. In my application.css.scss file I order the @imports so that variables get assigned before they get used.

Now, sure, I could take the C include file approach and always include everything needed into each file but that seems repulsive ... especially since the order of the css files makes a difference.

Also, if you search Stack Exchange, you will find people complaining that precompiling assets takes a long time. I wonder if it is because there is dramatic overkill on how much is being precompiled.

I would be surprised if I'm the first to encounter this. I am wondering what others are doing or considering doing.

Thank you, Perry Smith

The default setting for config.assets.precompile returns true (so the

asset will be precompiled) on any files not ending with .js and .css

with the exception of application.css and application.js (which do get

precompiled).

But my stylesheet files (to pick an example) end with .css.scss and are

included via @import statements by sass. I have not played with coffee

script but I would assume people that have files like foo.js.coffee also

include them into application.js. I thought the objective is to have

one big .js file and one big .css file.

You don’t want the individual ones precompiled, so (at least for me) this is fine. The manifest files (application.js,.css etc.) should require/import everything needed

Also, if you search Stack Exchange, you will find people complaining

that precompiling assets takes a long time. I wonder if it is because

there is dramatic overkill on how much is being precompiled.

Apparently it will be a lot faster in rails 4.

Fred