I have several task in my package.json like:
"scripts": {
"test": "jest",
"test:ci": "jest --runInBand --no-cache --watch false --coverage true",
"test:codecov": "codecov",
"tsc:check": "tsc --noEmit",
"prettier:check": "pretty-quick --staged"
.
.
. // a lot more here
}
I am trying to build a build script that depends on those tasks but write it as a new script in package.json is too verbose and hard to read.
Is there some way to run those scripts from a build.js file? so I can chain/redo those tasks and also get some error handling.
npm run <script_name>in yourbuild.jsfile?const process = require('child_process'); process.exec('npm run ...')