部署到 Firebase 托管中的特定目标
Deploying to a specific target in Firebase Hosting
我的 firebase.json 文件中有以下托管目标
{
"hosting": [
{
"target": "staging",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "production",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
我的 firebaserc 文件包含以下内容:
{
"projects": {
"default": "project-name177137"
},
"targets": {
"project-name177137": {
"hosting": {
"staging": [
"project-name177137"
],
"production": [
"productionName"
]
}
}
}
}
如果我想部署到所有我通常只做 firebase deploy
。
现在假设我只想部署到 staging 进行测试,我可以使用什么 firebase 命令来实现?
谢谢。
firebase deploy --only hosting:staging
我的 firebase.json 文件中有以下托管目标
{
"hosting": [
{
"target": "staging",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "production",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
我的 firebaserc 文件包含以下内容:
{
"projects": {
"default": "project-name177137"
},
"targets": {
"project-name177137": {
"hosting": {
"staging": [
"project-name177137"
],
"production": [
"productionName"
]
}
}
}
}
如果我想部署到所有我通常只做 firebase deploy
。
现在假设我只想部署到 staging 进行测试,我可以使用什么 firebase 命令来实现?
谢谢。
firebase deploy --only hosting:staging