Want to run multiple command in angular which will be executed one after another. like ng serve, ng bulid in sequencewise.
Asked
Active
Viewed 918 times
1 Answers
2
You could write additional script entries to combine commands.
package.json
{
"name": "My Project",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"tbuild": "ng test && ng build", // <-- test and build sequentially
},
"private": true,
"dependencies": {
...
},
"devDependencies": {
...
}
}
You could then run the script entry from the project root folder like
npm run tbuild
To run the commands in parallel see here.

ruth
- 29,535
- 4
- 30
- 57
-
Hi @Michael D, I tried to apply above script, but only one command in running i.e. ng test, ng build is not working in sequence, please check – Raman Mar 03 '21 at 08:50
-
Did `ng test` complete? You could also try `"tbuild": "npm run test && npm run build"`. – ruth Mar 03 '21 at 08:54
-
yes, ng test is complete, it is showing Total success test cases after that nothing is happening – Raman Mar 03 '21 at 08:57
-
Ok, Thanks @Michael D, – Raman Mar 03 '21 at 09:17