How to make a build for all environments

27 views
Skip to first unread message

Jagadesh Paladugula

unread,
Jul 20, 2017, 2:04:28 AM7/20/17
to ang...@googlegroups.com
Hello Everyone,

We are using angular js 2 in one of our projects, and using angular-cli for building the projects.

Right now, we have extracted the properties into environment.ts files, which include api endpoints and other  things. and we have one file for each environment as per the documentation. we have multiple environmentss like, DEV, QA, STAGE and PROD.

Right now we build for specific environment and move the dist folder to ngnix server for deployment.

The problem over here is, we have to build it separately for every environment. Is there a way where we build it once and same build works for all environments.

eg.
ng build --env=dev
ng build --env=qa
ng build --env=stage
ng build --env=prod


Regards,
Jagadesh




 

--
Regards
Jagadesh

Sander Elias

unread,
Jul 20, 2017, 2:33:49 AM7/20/17
to Angular and AngularJS discussion
Hi Jagadesh,

you can use the output-path parameter to specify a different path for each environment. Something like:

ng build --env=dev -op dist/dev
ng build
--env=qa -op dist/ga
ng build
--env=stage -op dist/stage
ng build
--env=prod -op dist/prod

Would that do for you?

Regards
Sander


Jagadesh Paladugula

unread,
Jul 20, 2017, 3:11:01 AM7/20/17
to ang...@googlegroups.com
Ideally it will work. But my build time will be increased by n number of times.

Is there a better way.

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Jagadesh

Sander Elias

unread,
Jul 20, 2017, 4:45:27 AM7/20/17
to Angular and AngularJS discussion
Not right now, but there is work being done on this. No timeframe set though!

Jagadesh Paladugula

unread,
Jul 20, 2017, 8:39:38 AM7/20/17
to ang...@googlegroups.com
Ok. Thanks. 

On Thu, Jul 20, 2017 at 2:15 PM, Sander Elias <sande...@gmail.com> wrote:
Not right now, but there is work being done on this. No timeframe set though!

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Jagadesh
Reply all
Reply to author
Forward
0 new messages