Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build once, deploy many, with Angular-CLI

Tags:

I'm using angular-cli (beta 26). For local development it's great, but I'm struggling to see how it can fit into a more serious "build once, deploy many" type of pipeline?

I'm using the built-in concept of an environment to store environment specific information, e.g. connection strings. But I'm required to specify the environment at build time, by using ng build --environment=xyz. This basically means I have to do a fresh build for every deployment. Idealy I'd like to select my environment at runtime (much like can be done with ASP.NET Core for example).

Am I missing something here? Is there another way to solve this problem?

like image 841
MEMark Avatar asked Jan 25 '17 09:01

MEMark


1 Answers

This was quite thoroughly discussed in the https://github.com/angular/angular-cli/issues/3855#issuecomment-274803729. Probably you know the answer already, but since it's not linked here I'm posting so anyone can see it.

Basically angular-cli environments are designed to be build-connected, so we have to custom-load e.g. a json file with runtime config.

like image 65
janekw Avatar answered Sep 22 '22 11:09

janekw