Is there any way to read post number and host name form environment.ts file and run the ng serve command. My requirement is to use different port and host for Dev, QA and Prod environments.
Now I am manually changing it in angular.json file
"serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "port": 5001 "host":'10.20.45.10' },
I want to read it form environment.ts and environment-prod.ts according to the build
the environment will be a great place for configuration when the angular app is running ,but in here we try to run the cli based on configuration file , I was looking to set this in the
angular.jsonfile but I face dead end , so I go to write a node script will get the configuration from a file then run the cli base of that configuration ,maybe there is a better way but this what we come out with .I have use here ts-node
run.ts
configration file
run-tsconfig.json(I have copy this one from tsconfig.json)environment.prod.ts
environment.ts
run the cli serv base of production url
by default will read the url information from environment.ts (dev)