Last active
December 19, 2015 18:19
-
-
Save juliocesar/5997750 to your computer and use it in GitHub Desktop.
Enabling caching in Sprockets
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
# Enables caching in Sprockets | |
# ============================ | |
# | |
# I couldn't find it documented anywhere until I searched for it. Sprockets will recompile | |
# every file in a manifest for every request it serves if even *one* file in it changes, | |
# which it really slow for developing anything. | |
# | |
# This fixes that by ensuring only files that get changed get recompiled. NOTE: This is | |
# just an example. What you're looking for is in line 14. | |
Hopla.compiler = Sprockets::Environment.new Pathname(Hopla.Root) do |env| | |
# Cache. | |
env.cache = Sprockets::Cache::FileStore.new(Dir.tmpdir) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment