I tried to use npm-watch as file watcher to compile scss files. As I run npm run watch
, the script runs and does what I expected. But after the run, it immediately ends and does not run again on file change. In other words, it works but it does not watching. It only runs once. What could be the problem?
This is package.json
{
"name": "limitless",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"autoprefixer": "^10.2.5"
},
"devDependencies": {
"jshint": "^2.10.3",
"node": "14.16.0",
"node-sass": "^5.0.0",
"npm-watch": "^0.11.0",
"uglify-js": "^3.16.1",
"uglifycss": "^0.0.29"
},
"watch": {
"patterns": ["www/scss"],
"extensions": ["scss"],
"delay": "2000"
},
"scripts": {
"watch": "node-sass www/scss/theme.scss www/css/theme.css"
}
}