1

I have just upgraded from Angular 7 to Angular 14.

One of the breaking changes is ng b --prod is no longer recognised; instead it is now ng b --configuration=production.

Is there any way I can map ng b --prod to ng b --configuration=production?

Thank you.

R. Richards
  • 24,603
  • 10
  • 64
  • 64
taylorswiftfan
  • 1,371
  • 21
  • 35
  • Does this answer your question? [What is the shortest way to create an alias that take a parameter?](https://stackoverflow.com/questions/47536155/what-is-the-shortest-way-to-create-an-alias-that-take-a-parameter) – Makoto Jun 12 '22 at 23:56
  • Long story short: you want an alias (a way to make one command be another) but you also need to take a parameter, and the only way you can do that is to create a function in your shell dialect of choice. Alternatively...you could also just modify whatever it is that's running this command to the new parameter instead, which would involve a whole *lot* less gnashing of teeth in this context. – Makoto Jun 12 '22 at 23:57
  • Hmmm.... I was expecting something to be defined in the `angular.json` file? – taylorswiftfan Jun 13 '22 at 00:34
  • I'm not familiar with Angular so I wouldn't know, but I suppose the next question I have - what is the requirement to do this? Could you not change whatever you're using to use the new parameter instead? Why go through the hassle (from an outsider's perspective)? – Makoto Jun 13 '22 at 01:13
  • Because - out of sheer laziness - it represents more characters to type and also more opportunities for typo. `ng b --prod` is a lot more straightforward. – taylorswiftfan Jun 13 '22 at 09:30

0 Answers0