node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

--watch option is deleting contents of output css file when used in package.json script

Open laurencefass opened this issue 4 years ago • 0 comments

im trying to set up the simplest possible sass compiler with package.json with two folders ./scss and ./css for input and output.

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "watch-scss": "node-sass --watch --recursive scss --output css"
    "build-scss": "node-sass --recursive scss --output css"
  },

results:

npm run build-scss works as expected, but of course it needs manual rebuilt after every change. npm run watch-scss generates the message:

> [email protected] watch-scss /var/www/html/web/themes/custom/mycustom_barrio
> node-sass --watch --recursive scss --output css

=> changed: /var/www/html/web/themes/custom/mycustom_barrio/scss/custom.scss
Rendering Complete, saving .css file...
Wrote CSS to /var/www/html/web/themes/custom/mycustom_barrio/css/custom.css

but it then empties the file created using npm run build-scss

laurencefass avatar Jul 27 '21 21:07 laurencefass