11 Mayıs 2018 Cuma

Angular5 Build Prod with base href

In normally angular2 and higher version projects building for prod with following command;

ng build --prod 

But sometimes we need to subdomain like domainname.com/subdomainname/ , in this situation we need to use base-href command to deploy properly otherwise it won't be work without console error.

To use base-href and define subdomain whichs is work like a directory, we just need to use following command:

ng build --prod --base-href /subdomainname/

with this command , we can solve this issue and deploy our project without any problem..
Yunus Emre Web Developer

Morbi aliquam fringilla nisl. Pellentesque eleifend condimentum tellus, vel vulputate tortor malesuada sit amet. Aliquam vel vestibulum metus. Aenean ut mi aucto.