大卫在他的回购中:
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)