ElwoodP
ElwoodP

Reputation: 428

Sprite generation Compass/SASS

I'm using Compass Sprite helpers in a project which works great. However the generation of the sprite adds quite a few seconds to the project compile time and most of the time I do not need it regenerated.

Is there a way to turn off the sprite generation and get compass to use the last generated file?

I'm using CodeKit and I'll be easily confused by much talk of command line / Ruby!

Upvotes: 0

Views: 1165

Answers (3)

phils
phils

Reputation: 73246

It looks as if compass compile with no other arguments (as per Andrey 'lolmaus's answer) does not cause this, but if there are any arguments at all it sets the :force option to true, and one of the consequences of that is that sprites are forcibly recreated.

That seems like crazy behaviour?

For the moment I've edited lib/compass/commands/update_project.rb (specifically, in my case, ~/.rvm/gems/ruby-1.9.3-p429/gems/compass-0.12.4/lib/compass/commands/update_project.rb) and commented out the parser.options[:force] = true line in the parse_arguments! function at the end of that file.

(note the unless arguments.empty? condition)

That seems to have disabled sprite generation entirely (i.e. even when you need it), but I can enable it manually with compass compile --force ...

That's certainly good enough for me.

Upvotes: 0

ElwoodP
ElwoodP

Reputation: 428

It looks like a CodeKit issue which is getting fixed: https://github.com/bdkjones/CodeKit/issues/297

Until then I am using a workaround detailed here.

Upvotes: 0

I've just tried it, and for me Compass does not recompile my sprites unless i modify the contents of the sprites folder:

$ compass compile
unchanged images/sexy-sce786a2ec5.png
overwrite stylesheets/screen.css

Try compiling your project with the compass command line tool instead of CodeKit. If it works out, please check that CodeKit uses Compass to compile your project and not vanilla SASS.

Upvotes: 1

Related Questions