How to remove the hash from Compass's generated sprite image filenames?

后端 未结 4 1219
轻奢々
轻奢々 2020-12-05 08:24

Compass uses chunky_png to render the sprites. It adds a hash to the end of the file to force caches to download the new image sprites. Is there a way to turn this cache bus

4条回答
  •  独厮守ぢ
    2020-12-05 08:40

    Better solution can be found in another similar question.

    It's better because:

    1. Script changes name before generating sprite - not after.
    2. Because of point 1. there is no need to hardly change .css auto generated file. It's generated with correct name from beginning.
    3. Accepted solution makes cp (copy) of generated sprite with hash and it stays in file system / repo as duplicate which is quite bad. Additionally it's still seen as changed with local repo so you commit two identical files. Solution could do mv to change generated hash file name to clear one, but in this case sprite would be generated every time you use it in .scss file so it's even worse.

提交回复
热议问题