Using NPM compile SASS to css

Updated on June 27, 2020
On your project you have to run npm init -y then install node sass package

npm install node-sass-chokidar --save

In the package.json, add this 2 lines

{
  "name": "clean",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "sass": "node-sass-chokidar style.scss --output css --source-map-embed --source-map-contents --output-style compressed",
    "watch:sass": "npm run sass -- --watch"
  },
  "dependencies": {
    "node-sass-chokidar": "^1.5.0"
  }
}

Then save, and run

npm run watch:sass