Skip to content

Instantly share code, notes, and snippets.

@ancorcruz
Forked from fxn/gist:427dca61ec44adf8253b
Last active August 29, 2015 14:21
Show Gist options
  • Save ancorcruz/a131cf90a034c67cb7dd to your computer and use it in GitHub Desktop.
Save ancorcruz/a131cf90a034c67cb7dd to your computer and use it in GitHub Desktop.
# Sprockets 2 does this, but Sprockets 3 axed this feature.
namespace :deploy do
after :normalize_assets, :gzip_assets do
on release_roles(fetch(:assets_roles)) do
assets_path = release_path.join('public', fetch(:assets_prefix))
within assets_path do
execute :find, ". \\( -name '*.js' -o -name '*.css' \\) -print0 | xargs -0 gzip --keep --best --quiet --force"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment