Tom*_*Tom 6 firebase firebase-hosting firebase-cli
我在 >Firebase >Hosting >Main 中有两个 Firebase 托管站点(https://console.firebase.google.com/u/0/project/example/hosting/main)
1. **foobar**.web.app (default project from setup process)
2. **example**.web.app (added as an additional web app under the main project and linked for hosting)
Run Code Online (Sandbox Code Playgroud)
这些是我的.firebaserc设置:
{
"targets": {
"foobar": {
"hosting": {
"foobar": [
"foobarWebApp"
]
}
},
"example": {
"hosting": {
"foobar": [
"foobarWebApp"
],
"example": [
"foobar"
]
}
}
},
"projects": {
"default": "foobar"
}
}
Run Code Online (Sandbox Code Playgroud)
从Firebase CLI运行firebase deploy后,文件将部署到foobar .web.app。如何将其更改为示例.web.app?
我试过了,firebase deploy --only hosting:example
但总是返回错误:发生意外错误。
您是否正确设置了托管目标?
\n\n在您的 CLI 中,
\n\nfirebase target:apply type target-name resource-name
hosting
.foobar
或example
为 Firebase 资源设置部署目标后,请在firebase.json
配置文件中引用应用的目标名称。
请参阅https://firebase.google.com/docs/cli/targets
\n\n编辑:
\n\n你.firebaserc
应该看起来像这样,(尽管运行上面的命令行语句应该已经为你改变了这一点,并且你需要更新的是)package.json
:
"projects": {\n "default": "project-name"\n},\n"targets": {\n "project-name": {\n "hosting": {\n "example": [ // target-name\n "example-website" // resource-name\n ],\n "foobar": [ // target-name\n "foobar-website" // resource-name\n ]\n }\n }\n}\n
Run Code Online (Sandbox Code Playgroud)\n
归档时间: |
|
查看次数: |
2358 次 |
最近记录: |