我正在寻找有关如何在我的 Angular 6.0 项目上正确设置 firebase-tools
托管的教程,我发现的总是这样。
- 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
但在这样做之后,这就是我所拥有的。
最佳答案
我发现 ng build --prod
会在项目位置下创建一个 dist
和另一个子文件夹。
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
并将 public 目录 从 dist
更改为 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 托管部署不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50360477/