The situation is this ... For the work of VUE-SSR, 2 bundles are assembled - one for the server, the other for the front. Each time they change the code, they must be rebuilt ... in order to work out normally, watch watches hang for automatic reassembly of these bundles. In addition, I still have a server running, also with a watcher (separately for the backend files) + I need to run Mongu.
If I run the project through the npm command, which combines several npm run one && npm run two && npm run three commands, then if the first command is with the watcher, then the next one does not start.

As a result, in order to run the project, I need to open 4 terminals and run 4 npm commands. 1) Launch Mongi; 2) Starting the server; 3) Building a Vue server bundle; 4) build the Vue client bundle. It is a bit annoying.

Who can tell how to get out of the situation?

  "scripts": { "build-client": "webpack --config build/webpack.client.config.js --progress --watch --hide-modules", "build-serv": "webpack --config build/webpack.server.config.js --progress --watch --hide-modules ", "serv": "supervisor --watch backend index.js " }, 

    1 answer 1

    A great solution would be the npm-run-all package. It allows you to use such CLI utilities:

    • run-s run-s one two three - execute your commands sequentially, as you have now
    • run-p run-p one two three - executes your commands in parallel, that is, as you need