-
-
Save BenV/dc2b0f3a9f5c755cadb1 to your computer and use it in GitHub Desktop.
Disable Sprockets asset caching when cache_classes=true for development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sprockets configuration: prevent sprockets from caching assets in development | |
# when cache_classes is set to true | |
sprockets_env = nil | |
config.assets.configure do |env| | |
sprockets_env = env | |
# Sprockets environment configuration goes here | |
# env.js_compressor = :uglifier # or :closure, :yui | |
# env.css_compressor = :sass # or :yui | |
end | |
if config.cache_classes | |
config.after_initialize do | |
Rails.application.assets = sprockets_env | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment