To ensure continuous watching, you need to execute a single command in the package.json file.
Modify the "scripts" section in the package.json file as shown below:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-css": "node-sass --include-path scss scss/main.scss public/css/main.css",
"watch-css": "nodemon -e scss -x \"npm run build-css\""
},
In the build-css script, specify the paths for both the scss and css files.
Next, run the following command in your command prompt:
npm run watch-css
Now, you are all set to go.
For more detailed information, you can also visit this link:
https://medium.com/@brianhan/watch-compile-your-sass-with-npm-9ba2b878415b