相关疑难解决方法(0)

如何从'/ functions'以外的其他目录部署函数?

大卫在他的回购中:

https://github.com/davideast/react-ssr-firebase-hosting

具有firebase功能的文件index.js在主根目录中,而不是/functions目录中.

但是,如果我这样做并将我的index.js文件放到主根,如果我这样做firebase deploy --only functions,请在控制台中说:

i  deploying functions

Error: functions\index.js does not exist, can't deploy Firebase Functions
Run Code Online (Sandbox Code Playgroud)

:他怎么可能让它发挥作用?我怎么能这样做并从其他目录成功部署功能/functions

谢谢

firebase.json

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "function": "ssrapp"
      }
    ]
  },
  "functions": {
     "source": "/"
  }
}
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-functions firebase-cli

6
推荐指数
2
解决办法
3247
查看次数