ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
976 stars 78 forks source link

Image references not updated in css file #96

Open arunn opened 10 years ago

arunn commented 10 years ago

Hi,

I'm using turbo-sprockets-rails3 gem along with asset sync. I have 3 scss files. application.css.scss, application_2.css.scss, application_3.css.scss. All of them use the same image image.png( eg. image-url('image.png')). Whenever I update the image.png and deploy, the application.css and application_2.css are updated with the latest references to the image whereas application_3.css is not getting updated leading to image not found errors.

This error happens only for the application_3.css even for other images which are referenced only in that file.

Any ideas about this problem?

arunn commented 10 years ago

On further investigation I found that the 2 files where the image reference were getting updated had "@import" directive whereas the other one did not have such directives. When I removed the directive from the other 2 files, the same problem was reproduced in those files as well. Is this the expected behavior?

reshubhan commented 9 years ago

I am also facing almost same issue like this, i am using an svg image, so what i have done is

  1. i have changed the image but did not change the name
  2. The image gets new fingerprint but it does not get updated in the css file , where it is referenced
  3. Becaues the css did not change, so CSS does not take the new image,

Does this have a work around

Code Snippet :-

.header-menu .search-submit-button { /background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANAAAALGCAYAAAA0tB%2FbAAAqCEl…Cj8F1k%2FxYIBN6c0vB%2BFf8r3UDgxL0gfpXiJ8W%2FgosPxpOAOLkAAAAASUVORK5CYII%3D");/ background: image-url('intuit_com/images/components/hero_carousel/global-sprite-fallback.png') no-repeat; background: none, image-url('intuit_com/images/components/hero_carousel/global-sprite.svg') no-repeat; /* Retina display support */ background-repeat: no-repeat; }