Why does Sass cache folder get created

Sass

Sass Problem Overview


I have started trying out Sass for my css work. In the directory where my Css file resides I see a '.sass-cache' folder too. Can any one tell me why is this folder created and is it safe if I delete it.

thanks,

Sass Solutions


Solution 1 - Sass

By default, Sass caches compiled templates and partials. This dramatically speeds up re-compilation of large collections of Sass files, and works best if the Sass templates are split up into separate files that are all @imported into one large file.

Without a framework, Sass puts the cached templates in the .sass-cache directory. In Rails and Merb, they go in tmp/sass-cache. The directory can be customized with the :cache_location option.

If you don’t want Sass to use caching at all, set the :cache option to false.

You can configure the Sass cache location by setting a Sass option in your compass configuration file like so:

sass_options = {:cache_location => "path\to\tmp\sass-cache"}

Source: Sass reference

Solution 2 - Sass

If your main problem is "inhibiting pushes to development environments when multiple developers use/change it", you can add it to your .gitignore file. As stated in the other answer, Sass cache files speed up compilation based on whether a Sass file has changed since last compile.

In my experience it's standard practice to consider them temporary files, and omit them from version control.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPavView Question on Stackoverflow
Solution 1 - SassAhmad AlfyView Answer on Stackoverflow
Solution 2 - SassRobWView Answer on Stackoverflow