0

So I have a 2 repo app (frontend, backend). I want to be able to run these apps at the same time with one command. So I tried using concurrently

I have these commands:

./backend/package.json

"scripts": {
  "build": "webpack --config webpack.config.js",
  "watch-webpack": "yarn build --watch",
  "watch-node": "nodemon \"./dist/bundle.js\"",
  "start": "concurrently -n \"webpack,node\" -c \"bgBlue.bold,bgGreen.bold\" \"yarn watch-webpack\" \"yarn watch-node\" -k"
}

./package.json

"scripts": {
  "watch-backend": "cd backend & yarn start",
  "start": "concurrently -n \"backend\" -c \"fgGreen.bold\" \"yarn watch-backend\""
}

I know it's silly now, but I will need to add another command to the main package for frontend, hence my question.

I like how I can set up the code to show which process logs what, as in backend now:

enter image description here

And I'd like to keep it like this for my full stack config.

How do I do it? How do I run multiple concurrently commands at the same time? Or is it just a silly overkill and there is a better way?

Currently when I try to start the concurrently inside of another concurrently I get this monstrosity:

enter image description here

it seems to be just starting in a loop.

Alex Ironside
  • 3,018
  • 4
  • 26
  • 74

0 Answers0