Sass --watch不重新编译 [英] Sass --watch not recompiling
问题描述
当我将更改保存到 build.scss
时,Sass更新了我的主样式表 build.css
,但是当我保存时不会更新 build.css
保存对任何局部的更改,例如 _grid-settings.scss
.基本上,每次我对部分内容进行更改时,我都必须手动重新保存 build.scss
,以便Sass能够检测到更改.
Sass updates my main stylesheet build.css
when I save changes to build.scss
, but will not update build.css
when I save changes to any partials, for example _grid-settings.scss
. I essentially have to manually re-save build.scss
each time I make a change to a partial in order for Sass to detect a change.
在我的终端上:
Justins-MacBook-Air:ageneralist justinbrown$ sass --watch stylesheets:stylesheets
>>> Sass is watching for changes. Press Ctrl-C to stop.
write stylesheets/build.css
[Listen warning]:
Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback.
我的目录是:
stylesheets/
├── base
│ └── _base.scss
├── build.css
├── build.scss
├── layout
│ └── _layout.scss
└── vendor
├── _grid-settings.scss
├── bourbon
├── highlight
└── neat
我正在使用:
- Sass 3.3.8.
- Ruby 2.0.0-p353
- OSX 10.9
我已经浏览了几篇关于 sass --watch
问题的SO帖子,但没有一个帮助我找到解决方案.
I've looked through several SO posts on issues with sass --watch
but none have helped yet to guide me to a solution.
我在这里添加我的 build.scss
,以防万一,这是问题所在:
I'm adding my build.scss
here just in case that's the issue:
@import "vendor/bourbon/bourbon";
@import "vendor/grid-settings";
@import "vendor/neat/neat";
@import "base/base";
@import "layout/layout";
推荐答案
这对我来说不是一个令人满意的答案,但是我最终尝试了另一种可以进行预处理的gem, guard-livereload
,尽管它本身不起作用,但是当我回来尝试 sass --watch
sass时,它会正确监视我的样式表目录中的更改(包括部分内容),并随后重新编译了 build.scss 代码>.
This isn't a satisfactory answer for me, but I ended up trying out another gem that would handle preprocessing, guard-livereload
, and though it itself didn't work, when I came back to try sass --watch
sass properly monitored my stylesheets directory for changes (partials included) and subsequently recompiled build.scss
.
我不确定为什么它现在可以工作,但是我猜想与防护装置或防护装置一起安装的宝石之一可以解决此问题.也许 listen
或 fssm
?
I'm not certain why it works now, but am guessing one of the gems installed along with guard or guard-livereload solved the issue. Perhaps listen
or fssm
?
这篇关于Sass --watch不重新编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!