sstephenson / ruby-yui-compressor

A Ruby interface to YUI Compressor for minifying JavaScript and CSS assets.
217 stars 57 forks source link

@font-face urls changed to full path #36

Closed autumnlansing closed 10 years ago

autumnlansing commented 10 years ago

Ruby-yui-compressor is changing the paths in my @font-face declarations to full paths rather than using the relative ones that I set in my css.

src:url('../fonts/icomoon.eot');

becomes, for example:

src:url(../opt/lampp/htdocs/projectname/library/fonts/icomoon.eot?1383875634);

stevecrozz commented 10 years ago

You must be using another tool on top of this gem, right? I tried compressing a @font-face declaration just to see, but I didn't see this behavior.

Can you please provide a CSS file that exibits this behavior and some steps I can follow to reproduce this bug?

autumnlansing commented 10 years ago

I use sass with compass and then jammit to run ruby-yui-compressor. Nothing else should be touching the css file. I used this same configuration on a previous project without this issue cropping up. I'm not sure what might be different other than perhaps an update of my gems.

CSS file: https://gist.github.com/autumnlansing/a00047728d7f5076d6e2

stevecrozz commented 10 years ago

Thanks for the gist. I downloaded that file and ran yui-compressor against it. My results differ from yours: https://gist.github.com/stevecrozz-rs/6f6d441a284dba212875

I suspect jammit is causing this behavior. Have a look at this issue: https://github.com/documentcloud/jammit/issues/167

stevecrozz commented 10 years ago

I'm closing this issue because I'm convinced that its Jammit changing your URLs. Please reopen if you think otherwise.