Single build of dist in angular for local,QA& prod. Read base_url from external property file












0















I developed a web application using Angular 4 and Spring Boot.

Designed UI in Angular4. I want to build dist for Local, QA and Production.



Every time when I build I have to change the base_url in the file for local, QA and production separately. I have learned that I can use environment file for this purpose. But in that case also I have to specify which I need in dist buil command (e.g., ng build --env=prod).



In this case also 3 times I have to run this build command.



How can I avoid this by using a single command for build for building the dist at once for local, qa and production?

Can I read this base_url from an external property file?










share|improve this question




















  • 1





    What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

    – GCSDC
    Nov 22 '18 at 4:37













  • Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

    – Delna M.A
    Nov 22 '18 at 4:48













  • Not sure on a simple way to do that. But why not configuring it inside the environment files?

    – GCSDC
    Nov 22 '18 at 5:12











  • If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

    – Delna M.A
    Nov 22 '18 at 6:14











  • Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

    – GCSDC
    Nov 22 '18 at 14:59
















0















I developed a web application using Angular 4 and Spring Boot.

Designed UI in Angular4. I want to build dist for Local, QA and Production.



Every time when I build I have to change the base_url in the file for local, QA and production separately. I have learned that I can use environment file for this purpose. But in that case also I have to specify which I need in dist buil command (e.g., ng build --env=prod).



In this case also 3 times I have to run this build command.



How can I avoid this by using a single command for build for building the dist at once for local, qa and production?

Can I read this base_url from an external property file?










share|improve this question




















  • 1





    What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

    – GCSDC
    Nov 22 '18 at 4:37













  • Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

    – Delna M.A
    Nov 22 '18 at 4:48













  • Not sure on a simple way to do that. But why not configuring it inside the environment files?

    – GCSDC
    Nov 22 '18 at 5:12











  • If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

    – Delna M.A
    Nov 22 '18 at 6:14











  • Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

    – GCSDC
    Nov 22 '18 at 14:59














0












0








0








I developed a web application using Angular 4 and Spring Boot.

Designed UI in Angular4. I want to build dist for Local, QA and Production.



Every time when I build I have to change the base_url in the file for local, QA and production separately. I have learned that I can use environment file for this purpose. But in that case also I have to specify which I need in dist buil command (e.g., ng build --env=prod).



In this case also 3 times I have to run this build command.



How can I avoid this by using a single command for build for building the dist at once for local, qa and production?

Can I read this base_url from an external property file?










share|improve this question
















I developed a web application using Angular 4 and Spring Boot.

Designed UI in Angular4. I want to build dist for Local, QA and Production.



Every time when I build I have to change the base_url in the file for local, QA and production separately. I have learned that I can use environment file for this purpose. But in that case also I have to specify which I need in dist buil command (e.g., ng build --env=prod).



In this case also 3 times I have to run this build command.



How can I avoid this by using a single command for build for building the dist at once for local, qa and production?

Can I read this base_url from an external property file?







angular typescript build






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 4:21









Jimi

7,65241833




7,65241833










asked Nov 22 '18 at 4:09









Delna M.ADelna M.A

1




1








  • 1





    What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

    – GCSDC
    Nov 22 '18 at 4:37













  • Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

    – Delna M.A
    Nov 22 '18 at 4:48













  • Not sure on a simple way to do that. But why not configuring it inside the environment files?

    – GCSDC
    Nov 22 '18 at 5:12











  • If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

    – Delna M.A
    Nov 22 '18 at 6:14











  • Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

    – GCSDC
    Nov 22 '18 at 14:59














  • 1





    What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

    – GCSDC
    Nov 22 '18 at 4:37













  • Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

    – Delna M.A
    Nov 22 '18 at 4:48













  • Not sure on a simple way to do that. But why not configuring it inside the environment files?

    – GCSDC
    Nov 22 '18 at 5:12











  • If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

    – Delna M.A
    Nov 22 '18 at 6:14











  • Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

    – GCSDC
    Nov 22 '18 at 14:59








1




1





What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

– GCSDC
Nov 22 '18 at 4:37







What about executing the commands together? ng build --configuration=local && ng build --configuration=qa && ng build --configuration=production . You then set the correponding file replacements and the outputPath on each of the configurations

– GCSDC
Nov 22 '18 at 4:37















Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

– Delna M.A
Nov 22 '18 at 4:48







Thank you!! Is there any way to use an external property file in angular4 to read the base_url from outside the dist.

– Delna M.A
Nov 22 '18 at 4:48















Not sure on a simple way to do that. But why not configuring it inside the environment files?

– GCSDC
Nov 22 '18 at 5:12





Not sure on a simple way to do that. But why not configuring it inside the environment files?

– GCSDC
Nov 22 '18 at 5:12













If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

– Delna M.A
Nov 22 '18 at 6:14





If configuring then also it required to join 3 build commands. right? I am trying to make 3 builds in one single command that's why.

– Delna M.A
Nov 22 '18 at 6:14













Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

– GCSDC
Nov 22 '18 at 14:59





Not sure how you will be able to do so, and also, seems a little risky to me. Chances are that something may be messed up between builds. Another alternative you may think of is using a task runner (maybe an integrated one on an IDE) to run all tasks you need at once.

– GCSDC
Nov 22 '18 at 14:59












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423772%2fsingle-build-of-dist-in-angular-for-local-qa-prod-read-base-url-from-external%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423772%2fsingle-build-of-dist-in-angular-for-local-qa-prod-read-base-url-from-external%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen