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.
According to the information, you can use the next command line: sass --watch . Show activity on this post. You can create one sass file which includes the rest of the files, and then just watch this file.
Open up Terminal and type the command cd desktop/project . This will bring you to the correct working directory on your desktop. Once you're in the project directory, write the command sass --watch scss:css to begin auto-compiling your Sass to CSS—provided you've already created the “scss” directory.
Create 1 scss file called combined. scss (for example) then inside of this file @import all your scss files, then simply run sass --style compressed --watch combined. scss:combined. css and it will detect changes to the imported scss files and recompile as needed.
Sass Importing Files Just like CSS, Sass also supports the @import directive. The @import directive allows you to include the content of one file in another.
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.
Expanding the answer by piouPiouM a little:
.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 .:.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With