Encountering an issue with the "--watch" or "-w" flag when running node-sass. After installing node-sass as a devDependency and setting up a script to compile SCSS code, everything runs smoothly without any flags. However, adding the "--watch" flag causes issues - the initial code doesn't compile and no file changes are detected. Extensive research has yielded no solutions so far. Below are the scripts for reference, and additional information can be provided if needed.
In package.json:
"scripts": {
"compile:sass": "node-sass sass/main.scss css/style.css"
}
Executing npm run compile:sass
successfully compiles the SCSS code:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c5aba4b1aab0b7b685f4ebf5ebf5">[email protected]</a> compile:sass /Users/lucabarcelos/WebstormProjects/AdvancedCSS/Natours
node-sass sass/main.scss css/style.css
Rendering Complete, saving .css file...
Wrote CSS to /Users/lucabarcelos/WebstormProjects/AdvancedCSS/Natours/css/style.css
However, updating the script like this:
"scripts": {
"compile:sass": "node-sass sass/main.scss css/style.css -w"
}
Results in the following output:
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b5dbd4c1dac0c7c6f5849b859b85">[email protected]</a> compile:sass /Users/lucabarcelos/WebstormProjects/AdvancedCSS/Natours
node-sass sass/main.scss css/style.css -w
The process appears to be waiting for file changes, but upon making changes, nothing happens at all.