Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 6.0 firebase hosting deploy not working

I am looking for a tutorial on how to properly setup the firebase-tools hosting on my angular 6.0 projects, and what I found is always like this.

- firebase init  - then select the Hosting - What do you want to use as your public directory? dist - Configure as a single-page app (rewrite all urls to /index.html)? Yes - Overwrite? No - ng build --prod - firebase deploy 

but after doing this, this is always what I've got.

default

like image 481
dotGitignore Avatar asked May 15 '18 23:05

dotGitignore


People also ask

How do you're deploy firebase hosting?

You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.


1 Answers

I found that the ng build --prod will create a dist and an another subfolder under this where the project location is.

dist |--TheProject_Folder |  |--assets|index.html - This index html is not using. |--index.html - This is the html generated in the firebase init 

So what I did is to initialize again the firebase init and change the public directory from dist to dist/TheProject_Folder:

- What do you want to use as your public directory? dist/TheProject_Folder - Configure as a single-page app (rewrite all urls to /index.html)? Yes - Overwrite? No 
like image 189
dotGitignore Avatar answered Sep 19 '22 07:09

dotGitignore