I have made my angular 6 website but while I am going to host on the firebase it show me the home Page of Firebase not My Angular Home Page
-
It is happening because you are not replacing existing index.html file of public folder. Replace existing index.html file with your own that is generated in dist folder. – Abhishek Raj Jul 13 '18 at 06:39
3 Answers
You need to configure firebase cli to upload the output of your build, not the default public folder that it created.
Inside firebase.json file change the public property:
"public": "dist/YourAppName",
You have to build the project before you upload it. One can create a script to automate this:
"deploy": "ng build && firebase deploy"
then you can run it with npm run deploy
.
You can also safely remove the public folder that firebase created since you won't use it for anything.

- 12,414
- 3
- 53
- 68
"firebase deploy" commands deploys the production files created by "ng build --prod" in dist folder. Just Update "public": "path till index.html file" in firebase.json file.
It should resolve the issue.

- 11
- 1
-
Hey Rakesh, thanks for posting an answer -- your answer will be more helpful for others if you could share more details, perhaps a relevant snippet of `firebase.json` file. – Derek Nguyen Jan 19 '19 at 15:14
I have been struggling with this and I just realized that firebase init creates another folder in dist (distributable) folder and gives it the name of your project. The index file in dist folder is the Firebase welcome message and so you need to give dist/project-name as your public folder so that your application shows when you visit the url provided by firebase console. Find more here.

- 24
- 2