Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

James Nelson
James Nelson
23,956 Points

Sass --watch

Hello, I just finished the Sass videos on treehouse however the sass --watch command has left me slightly confused.

Does this command watch all .scss files? For example if I have a scss file in my desktop and have a scss file in my documents, will this command watch both of these files and convert to css?

Thanks

3 Answers

It will watch whatever directory you ask it to, take the following example

cd C:\sites\portfolio\css
sass --watch .

It will watch on the .scss and .sass files in the CSS directory of that project

Thanks Adam

James Nelson
James Nelson
23,956 Points

Ahh! So it will watch wherever I run the command in.

What if I am working on two projects at once, do I just run the watch command in both folders where scss files are held?

Thanks

You can also chain paths together to watch multiple directories like so

sass --watch path/to/sass1:path/to/css1 path/to/sass2:path/to/css2 path/to/sass3:path/to/css3

never used this command before thou, I usually just restart sass in whatever project i am working on at that time. I did learn the other day from CSS-Tricks that you can type cd into prompt then drag a folder instead of typing path.

James Nelson
James Nelson
23,956 Points

Thats a handy tip, Thanks Adam :)

No problem. If you choose a best answer it will mark the question as solved.

Cheers