webpack is not running after starting separate expressJS service

Tags: , , , ,

For some reason I do not see webpack being kicked off. My script stops right after yarn start and never runs webpack-dev-server --watch --env=dev --open part of it in my dev script. I suppose that’s because the node service doesn’t exit and continues to run so I never get a completion hence the && webpack-dev-server --watch --env=dev --open never runs?

"start": "PORT=5000 nodemon --trace-warnings dist/server/server.js",
"build": "NODE_ENV=production webpack -p --env=prod --watch && yarn compile-server && yarn start",
"dev": "NODE_ENV=development yarn lint && yarn copyData && yarn compile-server && yarn start && webpack-dev-server --watch --env=dev --open",
"compile-server": "tsc -b ./src/server",
    "copyData": "mkdir -p dist/shared/data && cp src/shared/data/companies.json dist/shared/data && cp src/shared/data/countries.json dist/shared/data",

enter image description here


NodeJS is single threaded. It never left nodemon.

Source: stackoverflow