当前位置: 动力学知识库 > 问答 > 编程问答 >

Sass --watch . doesn't recognize change and overwrite

问题描述:

I'm having in issue with the sass --watch . command. I'm on a windows and I installed ruby and then sass according to instructions I found online. Seemed to work fine until I was using the sass --watch . command. When I enter it into the console, it finds the file and says Sass is watching for a change. When I open the file though and edit it, sass doesn't recognize that the file has been changed, and doesn't overwrite to the new file.

Any ideas?

网友答案:

You need to initiate compass before you can use compass watch.

Do so with:

compass create path/to/project/root/dir --sass-dir="path/to/your/sass" --css-dir="path/to/output/sass"

You should then have a compass config.rb in your project's root directory that looks like:

preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed

Then from that root directory you should be all set to run, compass watch, and have everything in your sass dir compile to your css dir.

分享给朋友:
您可能感兴趣的文章:
随机阅读: