Reputation: 383
I have angular 8 website which I build for production using following command:-
ng build --prod --configuration=production --base-href /eportal/*
I have created a folder "eportal" in hosting site and uploaded all components in the folder. It all worked fine and I can browse to the site using following url:-
Is there any method or any command available in Angular 8 where I can keep my components in "eportal" folder in hosting site but access in this way(removing folder name):-
Please help me on this.
Upvotes: 2
Views: 125
Reputation: 592
First of all the —prod flag is an alias to —configuration=production. Please take advantage of this
Coming to the question in particular, use the following command
ng build —prod
There should be assets generated in your dist/[app-name]/ folder.
In your hosting site, instead of uploading those assets in the folder you created upload them outside.
ie. You would have uploaded your assets in public_html/eportal instead of that upload them in public_html directly.
Upvotes: 3