嘗試將這些行添加到您的config.rb
:與Compass 0.12.2 (Alnilam)
module Compass::SassExtensions::Functions::Sprites
def sprite_url(map)
verify_map(map, "sprite-url")
map.generate
generated_image_url(Sass::Script::String.new(map.name_and_hash))
end
end
module Compass::SassExtensions::Sprites::SpriteMethods
def name_and_hash
"sprite-#{path}.png"
end
def cleanup_old_sprites
Dir[File.join(::Compass.configuration.generated_images_path, "sprite-#{path}.png")].each do |file|
log :remove, file
FileUtils.rm file
::Compass.configuration.run_sprite_removed(file)
end
end
end
module Compass
class << SpriteImporter
def find_all_sprite_map_files(path)
glob = "sprite-*{#{self::VALID_EXTENSIONS.join(",")}}"
Dir.glob(File.join(path, "**", glob))
end
end
end
對我的作品
看看是否有幫助:http:// stackov erflow.com/questions/9183133/how-to-turn-off-compass-sass-cache-busting – cimmanon
謝謝@cimmanon。那只是我正在尋找的答案。如果我知道這是一個緩存問題,我的搜索查詢可能讓我在那裏! –
這不是隨機的,它是[識別生成文件的哈希](https://github.com/Compass/compass/issues/1374)。它不應該在每次編譯時都改變,只有當精靈發生變化時。 – sam