-2

Want to run multiple command in angular which will be executed one after another. like ng serve, ng bulid in sequencewise.

Raman
  • 353
  • 1
  • 5
  • 13

1 Answers1

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