Npm script problem

requirements:
1, the gulp command generates the dist folder, performs the watch operation
2, and then executes nodemon, to restart node server once the dist generated by gulp changes

"scripts": {
    "server": "gulp && nodemon ./dist/app.js"
  }

problem: after
1 and gulp watch, the following nodemon commands will not be executed
2. If the operation is changed to parallel operation, gulp & nodemon. / dist/app.js, will report an error when starting server for the first time because there is no dist directory at the beginning.

is there a good solution to this requirement?

Mar.01,2021

you should write nodemon in the gulp watch callback

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e43766-42fe8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e43766-42fe8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?