Angular 6.0 Firebase托管部署无法正常工作 [英] Angular 6.0 firebase hosting deploy not working
本文介绍了Angular 6.0 Firebase托管部署无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找有关如何在我的angular 6.0项目中正确设置firebase-tools
托管的教程,而我发现的总是这样.
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.
推荐答案
我发现ng build --prod
将在项目位置所在的目录下创建dist
和另一个子文件夹.
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
所以我要做的是再次初始化firebase init
并将公共目录从dist
更改为dist/TheProject_Folder
:
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
这篇关于Angular 6.0 Firebase托管部署无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文