how to watch changes in whole directory/folder con

2019-01-10 07:34发布

How could I trace changes in whole directory containing many sass files ? I'm using the following command to watch changes in sass

file:

sass --watch style.scss:style.css

But how to watch changes in whole directory/folder containing many sass files.

8条回答
Melony?
2楼-- · 2019-01-10 08:09

According to the information, you can use the next command line:

sass --watch .

Source: http://sassbreak.com/watch-your-sass/#what-does---watch-do

查看更多
做个烂人
3楼-- · 2019-01-10 08:10

Just in case someone faces with this issue in 2018:
sass Website refers to Ruby Sass that is been deprecated. and as now (May 2018) if you install dart sass via npm , it does not support --watch command

What to do:
you need to install node-sass globaly , like:

npm install node-sass -g

and then restart the command line , then use this code:

node-sass --watch scss/styles.scss css/styles.css

to compile your scass files to css.
basically node-sass supports --watch command and we use that to compile our scss codes to regular css files.

and just in case you get an error like this at the first time that you save your .scss file:

{
  "status": 3,
  "message": "File to read not found or unreadable: yourdirectory/scss/styles.scss",
  "formatted": "Internal Error: File to read not found or unreadable: yourdirectory/scss/styles.scss\n"
}

what you need to do is save it again, it will work correctly!

查看更多
登录 后发表回答