mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Angular CLI ng build --prod Doesn't Work #163

Closed maks-humeniuk closed 5 years ago

maks-humeniuk commented 5 years ago

Hello.

It seems like ng build --prod flag doesn't work in this package.json:

"scripts": {
  "ng": "ng",
  "gulp": "gulp",
  "start": "run-p \"gulp merge-watch-translations\" \"ng serve\"",
  "server": "ts-node-dev --respawn ./server/server.ts",
  "build": "run-s \"gulp delete-dist\" \"gulp merge-translations\" \"ng build --prod\" \"gulp delete-translations\"",
  "test": "ng test",
  "lint": "ng lint",
  "e2e": "ng e2e"
}

ng build runs without --prod flag. How can I resolve this issue?

Configuration: Angular: 7.2.0+ Angular CLI: 7.2.1+ npm-run-all: 4.1.5+

mysticatea commented 5 years ago

Would you try \"ng -- build --prod\"?

mysticatea commented 5 years ago

run-s "ng build --prod" is equivalent to npm run ng build --prod and npm run command doesn't have --prod option. You have to use npm run ng -- build --prod to pass the argument to the script.

maks-humeniuk commented 5 years ago

@mysticatea, it works, thank you very much!