How can I get node-sass watch and live reload to work from a single NPM script?

后端 未结 6 1459
面向向阳花
面向向阳花 2021-01-02 23:30

Taking the following scripts section from a package.json:

\"scripts\":{
    \"sass:watch\": \"npm run sass -- -w ./src/public/stylesheets -r --s         


        
6条回答
  •  無奈伤痛
    2021-01-03 00:12

    you could try the concurrently package for npm

    npm install concurrently --save-dev

    then use it to run both of your script:

    "dev:watch": "concurrently  \" npm run sass:watch \" \" npm run livereload  \" ",
    

    you can find info about the package here: https://www.npmjs.com/package/concurrently

提交回复
热议问题