Search code examples
npmsassnode-sass

How can I run my live server & compile sass using node-sass simultaneously using a single command?


I want to run my app.js using "dev" : "nodemon app.js" and I have also added "node-sass": "node-sass public/sass/main.scss public/css/style.css -w"

My goal is to run live server using nodemon app.js only once. And compile sass to css everytime I edit my sass file and press ctrl + S without restarting my server.

I have tried it by adding "dev": " nodemon app.js && node-sass public/sass/main.scss public/css/style.css -w" .This command is running server successfully but its not compiling my sass to css whenever im trying Ctrl + s on sass file.


Solution

  • Use both commands on seperate terminals. Click the plus sign to open the terminal in the same directory or use git bash. enter image description here