-
Notifications
You must be signed in to change notification settings - Fork 109
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
Run image compress even if Rails.application.assets is nil #121
Conversation
Since rails/sprockets-rails@d7c7ee1#diff-b295f4f07d2e863f15e53eb2047cfd1f we can't rely on app.assets for register_preprocessor
Thanks for contribution! |
This class allow us to return result hash to skip gzip file generation
Rewrite conditions for register_preprocessor? For Sprocket intoduce new class ImageOptimProcessor, because proc object will use LegacyProcProcessor - this doesn't support return hash to configure asset by default Sprocket produce gzip file, if it has preprocessor for file, but this doesn't have sence because image is already optimized, if this pull request will be accepted rails/sprockets#221 then sprocket will skip gzip file generation. |
so we have: also rewrite code to fit your rubocop policies |
This pull request rails/sprockets#228 was merged to sprockets so can count on this behaiviour. |
Hey Anton, sorry for long wait with this. |
Since rails/sprockets-rails@d7c7ee1#diff-b295f4f07d2e863f15e53eb2047cfd1f we can't rely on app.assets for register_preprocessor
When compile=false and we precompile assets
register_preprocessor?(app) method will always return false