-
Notifications
You must be signed in to change notification settings - Fork 21.6k
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets:precompile will not change asset hash when image has changed #14638
Comments
Are you using CSS, sass or less? |
Sass, sorry. |
Is this sass using ERB too? Could you provide an example application reproducing this issue? Thanks. |
No ERB. I use the Here is the app: joallard/rails14638
|
Do you have only one |
I think so, I normally use the Heroku build process. I'm not 100% sure it calls |
@joallard maybe you are reading the wrong application.css and you already have other with the same content and with the right image digest. This is why sprockets doesn't precompile the css file again. Could you check? |
From what I gather, a new CSS isn't made. Here are my reproduction steps using my example repo from master:
|
I could reproduce your issue but not if I upgrade your application to use Rails 4.1 and sprockets-rails 2.1.2. What sprockets-rails 2.1.2 basically does is add dependency on the assets used with asset_path. Here is my reproduction steps:
|
Yup, looks like the update fixes it. Thanks for the followup. |
But wait, do you need to add |
No, you should not need. This is fixed on sprocket-rails 2.1.2 (Rails 4 doesn't work with it yet but I'm going to change this soon) |
Excellent. |
@joallard 4-0-stable branch should work with sprockets-rails 2.1.2 now. But I still need to release sprockets-rails 2.1.2 😄 |
No problem, it's a pretty minor problem, I just wanted you folks to be aware of it! |
I have a project where I reference an image from my Sass. On precompile, a hash is added to the image, and referenced in the CSS.
However, when I change the image, the new intelligent compilation process will detect that the Sass has not changed, and hence not recompile it. So, with my image changed, the old hash/image will appear and still be there.
As a workaround, I add a phony CSS class to force recompilation.
The text was updated successfully, but these errors were encountered: