为什么会创建 Sass 缓存文件夹 [英] Why does Sass cache folder get created

查看:41
本文介绍了为什么会创建 Sass 缓存文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始在我的 css 工作中尝试使用 Sass.在我的 Css 文件所在的目录中,我也看到了一个.sass-cache"文件夹.谁能告诉我为什么创建这个文件夹,如果我删除它是否安全.

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.

谢谢,

推荐答案

默认情况下,Sass 缓存已编译的模板和部分.这极大地加快了重新编译大量 Sass 文件的速度,如果将 Sass 模板拆分为单独的文件,这些文件全部 @imported 到一个大文件中,则效果最佳.

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.

在没有框架的情况下,Sass 将缓存的模板放在 .sass-cache 目录中.在 Rails 和 Merb 中,它们进入 tmp/sass-cache.可以使用 :cache_location 选项自定义目录.

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.

如果您根本不希望 Sass 使用缓存,请将 :cache 选项设置为 false.

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

您可以通过在指南针配置文件中设置 Sass 选项来配置 Sass 缓存位置,如下所示:

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"}

来源:Sass 参考

这篇关于为什么会创建 Sass 缓存文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆