Replace options of node-sass-chokidar to dart-sass

Viewed 995

I have following script in package.json, using with node-sass-chokidar, tried multiple combinations but not working. here is my current script:

build-scss": "npm run update-version && rimraf bundles/* && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o dist/css

and

"watch-scss": "npm run build-scss && node-sass-chokidar --watch ./src/ --recursive --include-path ./node_modules -o dist/css"

Want to replace the node-sass-chokidar with just, sass aka dart-sass.

Not able to figure out the right syntax, which can fulfil the existing requirements. I tried --load-path I tried the input : output syntax. no luck.

1 Answers
"build-css": "sass -I ./src -I ./node_modules src/:src/",
"watch-css": "npm run build-css && sass -I ./src -I ./node_modules src/:src/ --watch",

This is working for me. Let me know if you guys have questions. Other packages for reference would be the following.

"react": "17.0.2",
"react-dom": "17.0.2",
"@types/react": "17.0.40",
"@types/react-dom": "17.0.13",
"react-scripts": "5.0.0",
"sass": "1.49.9",

I think this is relevant to the above solution.

Related