W
W
Wasya UK2018-10-20 23:57:32
Node.js
Wasya UK, 2018-10-20 23:57:32

How to correctly describe the launch of scripts?

How to run scripts from two different directories at the same time?

"scripts": {
    "start": "node server",
    "build": "client/ npm run build",
    "dev": "nodemon server&&client/ npm start"
  },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JorJeG, 2018-10-21
@dmc1989

I usually use the npm-run-all package ( https://github.com/mysticatea/npm-run-all ) for different scripts
to shorten the dev script entry to run-p devserver buildwhere
devserver is nodemon server.
+ it is cross-platform.
And to run on the desired path:
npm run build --prefix client/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question