Welcome to the Treehouse Community
Looking to learn something new?
Using Sass with command prompt closed
I have Windows. Anytime I'm using Sass I have to have command prompt open, as soon as I close it, scss stops updating to css. Is there a way to tell Sass to watch the file and close the command prompt and just have it run in the background? Thanks.
James Barnett39,199 Points
That's how the terminal (on OS X / Linux) and the command prompt (on Windows) is supposed to work, if you ever want to post a process running in a terminal you just exit the terminal. If you put a process into the background, it will survive the exiting of the terminal.
The quick & dirty way to do this on Windows is to use the start command.
start /b sass --watch styles.scss:styles.css
If you run a command with
start /b and you want to restart that process at some point then you have to kill it by hand rather than just closing the terminal window.
To kill process that includes name
sass you could use"
wmic process where (name like "%sass%") delete
You could also get an add-on for your text editor that will auto-compile your Sass.
You can also use an app both Scout & Prepros are popular choices