我在一台 Windows 7 64 位机器上使用 Sass 和 Ruby(最新版本),我正在我的家庭服务器上处理一个共享文件夹。 (但是,我不得不承认问题本身也出现在服务器上,因为我试图安装 Ruby 并直接-watch
服务器上的文件)。
问题如下:如果我第一次保存,检测到变化,我的style.css
被直接覆盖。之后,我总是需要保存多达 7 次才能覆盖 style.css
。每次都会检测到更改,但不会编译任何内容。这是一个屏幕:
>>> Sass is watching for changes. Press Ctrl-C to stop.
overwrite style.css
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
>>> Change detected to: E:/Websites/xxx/wp-content/themes/xxx/sass/default-styles.sass
overwrite style.css
下面是我的 base.sass
,它导入了所有的部分:
// Core variables and mixins
@import variables
// Default HTML Formatting
@import default-styles
// Grid
@import grid
// Header and Menus
@import header
// Blog
@import blog
有没有人在 Windows 上遇到过类似的问题?
最佳答案
这个问题在评论中得到了回答。问题是服务器端和客户端的时间差导致的,所以服务器端直到时间戳超过时间差才会发起更新。
我发布此答案是为了将问题正确标记为已回答。
关于css - 检测到 Sass 更改但 style.css 仅在我保存时每 5 到 7 次被覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15524188/