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..