1

I have an angular app, with environment configs which helps it to connect to different API endpoints based on the configuration.

ng build --prod --environment={{ENV}} is how is build the app.

I copy the artifacts to the folder where tomcat hosts from. However, the local env is always picked out.

ng serve --env={{ENV}} would work, but how do i do the same using Tomcat?

Thanks, Pratik

Troopers
  • 5,127
  • 1
  • 37
  • 64
Pratik
  • 1,122
  • 8
  • 26

1 Answers1

0

It was an issue with the Angular CLI version.

https://github.com/angular/angular-cli/issues/7643

I currently have my CLI updated to

"@angular/cli": "1.6.3",
"@angular/compiler-cli": "^5.2.0"

If you do ng build --prod, it does pick up the environment-prod.ts now.

Pratik
  • 1,122
  • 8
  • 26