【发布时间】:2021-07-30 17:51:16
【问题描述】:
我正在为许多网站使用 Firebase 托管。有些网站有我想通过 Firebase 托管静态文件服务提供的静态文件,但是,其他一些网站只有我想利用 Firebase 的自定义域和缓存的动态内容。
firebase.json 中似乎需要 public 属性。这需要我部署一个包含虚拟文件的公用文件夹。
有没有办法在没有任何public 目录的情况下部署到 Firebase 托管?
以下给了我这个错误:Error: Must supply a public directory using "public" in each "hosting" config.
{
"hosting": [
{
"target": "index",
"public": "static",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "api",
"rewrites": [
{
"source": "**",
"run": {
"serviceId": "api",
"region": "us-central1"
}
}
]
}
]
}
【问题讨论】:
-
我为 Firebase 创建了一个功能请求:github.com/firebase/firebase-tools/issues/3349
标签: firebase-hosting google-cloud-run