Within my Express application, I utilize both nodemon
and browser-sync
in conjunction. These npm scripts are included in my package.json
:
"scripts": {
"start": "node ./bin/www",
"start:nodemon": "nodemon ./bin/www",
"start:debug": "SET DEBUG=img:* & npm run start:nodemon",
"start:browser-sync": "browser-sync start --proxy 'localhost:3000' --files 'public,views'",
"test": "npm run start:debug & npm run start:browser-sync"
}
Currently, I open two separate cmd
windows. In the first window, I execute start:debug
, while in the second window I run start:browser-sync
. This setup functions correctly.
I have pondered the idea of merging these scripts and triggering them simultaneously, similar to what is done in my test
script. However, this approach does not yield the expected outcome. It appears to initiate nodemon
but overlooks browser-sync
. Is there a way to execute these two scripts together with a single npm script, or is it technically unfeasible, necessitating separate cmds
for execution? Your insights are appreciated. Thank you.