Created
December 13, 2016 22:39
-
-
Save kml/e592bfc2f746e1e0b46227b3451f0992 to your computer and use it in GitHub Desktop.
Don't check if asset is precompiled on development.
This file contains hidden or 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
# config/initializers/assets.rb | |
if Rails.env.development? | |
Rails.application.config.assets.precompile = [] | |
# Don't check if asset is precompiled on development, | |
# because building "precompiled_assets" list is taking quite long time. | |
# | |
# Default: https://github.com/rails/sprockets-rails/blob/89ba006950caba495954fbb1626919bfe4ee7838/lib/sprockets/railtie.rb#L31 | |
# "Called from asset helpers to alert you if you reference an asset URL that | |
# isn't precompiled and hence won't be available in production." | |
::Rails::Application.class_eval do | |
def asset_precompiled?(_logical_path) | |
true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment