5

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.

Nikhil
  • 417
  • 1
  • 6
  • 16
  • Did you find the solution? I am also trying to replace with node-sass-chokidar with sass and facing the same issue. – Shalini Mar 03 '22 at 06:28
  • Yes- was: "build-scss": "npm run update-version && rimraf bundles/* && sass -I=node_modules src:dist/css", and "watch-scss": "npm run build-scss && sass --watch ./src/:dist/css ./node_modules:dist/css", – Nikhil Oct 18 '22 at 23:21

1 Answers1

9
"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.

thekevshow
  • 774
  • 14
  • 36