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条回答
在下西门庆
2楼-- · 2019-01-10 07:49

if you are in your current folder then do the following to watch it.

F:\sass tutorial>sass --watch ./:./
查看更多
Melony?
3楼-- · 2019-01-10 07:52

Expanding the answer by piouPiouM a little:

  • Output files will be created with the same names as input files except ending with .css.
  • <input folder> and <output folder> can be the same.
  • Both folders can be the present working directory, so the following is valid:

    $ sass --watch .:.

查看更多
Evening l夕情丶
4楼-- · 2019-01-10 07:55

Simply use the command sass --watch <input folder>:<output folder>, like this:

$ ls -l
css/ sass/
$ sass --watch sass:css

Where <input folder> contains the Sass files and <output folder> that hosts the generated CSS files.

查看更多
你好瞎i
5楼-- · 2019-01-10 07:55

I ended up doing this without using Grunt or Sass-watch:

npm install -g watch
watch "sass assets/app.scss assets/dist/app.css" assets/css
查看更多
男人必须洒脱
6楼-- · 2019-01-10 07:56

You can create one sass file which includes the rest of the files, and then just watch this file.

Alternately, look into Grunt and the very good grunt-contrib-compass plugin

查看更多
冷血范
7楼-- · 2019-01-10 08:06

Go to you terminal and get to you folder then wrote:

 sass --watch .

this will watch all sass files and convert to css files with the same name. also you can do it in this way:

sass --watch ~/user/youUser/workspace/project/styles/

I hope this can help you.

查看更多
登录 后发表回答