Access environment variables in production build Angular 4

后端 未结 4 834
萌比男神i
萌比男神i 2020-11-28 15:07

I want to deploy a production build of angular app with a configurable api url for the user to test it out. I use the environment.ts but after the production build, I do not

4条回答
  •  醉梦人生
    2020-11-28 15:32

    • Put your configurations in a ts file, in assets folder
    • just like you are fetching environment.ts, fetch that file and use its configurations
    • Contents of assets folder is not minimized, thus they can be configured in production build as well

提交回复
热议问题