Frage

I've been trying out Jammit to compress jQuery 1.9.1, and although it minifies and compresses successfully, it appears to be generating an output file that's 50k larger than using jQuery's grunt scripts.

My assets.yml file contains:

javascript_compressor: closure

compressor_options:
  compilation_level: "ADVANCED_OPTIMIZATIONS"

Then I run it at the commandline

$ jammit

RESULTS:

145k : Jammit
 93k : jQuery grunt build scripts 

Can anyone explain why Jammit compression is doing such a poor job? Am I missing any flags?

Thanks!

War es hilfreich?

Lösung

Ok, turns out you need to install the gems that Jammit uses for each compressor, otherwise it will silently default back to its default compressor.

So, to get it to work with closure, i ran:

gem install closure-compiler --no-rdoc --no-ri

And poof, closure file started compressing down to 84k. That was a frustrating hour...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top