Permalink
Browse files

Disable sass cache store

Custom importer can't be serialized.

Closes #507
  • Loading branch information...
1 parent 8d2a455 commit 655f129fa910f7d46803fdc66d6d5de53a85f210 @josh josh committed Mar 10, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/sprockets/sass_template.rb
@@ -21,12 +21,13 @@ def render(context)
# Use custom importer that knows about Sprockets Caching
- cache_store = SassCacheStore.new(context.environment)
+ # cache_store = SassCacheStore.new(context.environment)
options = {
:filename => context.pathname.to_s,
:syntax => syntax,
- :cache_store => cache_store,
+ :cache => false,
+ :read_cache => false,
:importer => SassImporter.new(context, context.pathname),
:load_paths => context.environment.paths.map { |path| SassImporter.new(context, path) },
:sprockets => {

6 comments on commit 655f129

That's a really unfortunate decision. Sass Caching is really useful in terms of speed, and as far as I can tell can be safely accomplished. See https://github.com/LRDesign/sass-rails-source-maps/blob/master/lib/sass-rails-source-maps/sass_importer.rb

Yeah, I'm with @nyarly on this one. The whole point of this exercise was to make the caching work properly to achieve that speed boost.

Contributor

josh replied Mar 10, 2014

Please open a PR.

https://github.com/glebtv/compass-rails-source-maps/blob/master/lib/compass-rails-source-maps/sass_importer.rb#L30-L38
This seems to be a way to serialize and deserialize a custom importer.
Looks like you don't need (and should not) dump whole sprockets context, just path and recreate context from current environment in ::Rails.application.assets. Isn't this correct?

conf replied Dec 16, 2014

Any news here? I tried to find PR but without any luck, did you make it?
/cc @nyarly @cheald

Please sign in to comment.