Firebase托管部署到其他站点 [英] Firebase hosting deploy to other site
问题描述
如何部署到同一项目中定义的其他Firebase托管站点. 我创建了多个托管站点"的firebase. 命令
how to deploy to other firebase hosting sites defined within the same project. I created multiple firebase hosting "sites". The command
firebase deploy
但是总是部署到第一个. 如何指定将静态文件部署到另一个站点"(和域).
however always deploys to the first one. How can I specify that the static files get deployed to another "site" (and domain).
谢谢
推荐答案
You have to add the other sites as deploy targets. If you have a second site named awesome-site-d3426
:
$ firebase target:apply hosting awesome-app awesome-site-d3426
对于主站点,您可能需要做同样的事情.
You'll likely have to the same thing for the primary site.
告诉Firebase将什么部署到firebase.json
中的哪些目标:
The tell Firebase what to deploy to which targets in firebase.json
:
{
"hosting": [
{
"target": "awesome-site",
"public": "awesome-site/dist"
},
{
...
}
]
}
然后您可以一次部署所有站点或特定站点:
You can then deploy all the sites at once or a specific site:
$ firebase deploy --only hosting:awesome-site
这篇关于Firebase托管部署到其他站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!