问题
As suggested here: "https://firebase.googleblog.com/2016/07/deploy-to-multiple-environments-with.html", one should use multiple projects (preferably name-differentiated into dev, staging, production, etc) to be able to have a test environment like that on Firebase Hosting.
But again, this document speaks about this approach in the context of Firebase Hosting. Is the same to be followed for Firebase Cloud Functions, if I do not want to update my already live, "production" function before testing the "development" version, or is there an alternate approach which can be followed?
I don't think I can simply add another Firebase Function, as code would still remain shared between the "production" version and the "development" version, which can cause problems in the "production" version.
回答1:
The use of dedicated projects for each enviornment is the same recommended practice for all Firebase products.
来源:https://stackoverflow.com/questions/52168587/firebase-functions-version-of-deploy-to-multiple-environments