Firebase 部署——只有函数可以覆盖现有函数

运行 firebase deploy --only functions在创建新函数之前删除现有函数。是否可以将此行为修改为 create if not exist, update if exists, no actions if functions not being deployed

59823 次浏览

firebaser here

Running firebase deploy will deploy all functions in the project. There is currently no option to deploy just new or modified functions.

It does sound like a useful addition though, so you might want to file a feature request.

Update: since version 3.8 of the Firebase tools CLI this is possible. See Pablo's answer or the release notes.

You can use firebase partial deploys

$ firebase deploy --only functions:makeUppercase

Will only deploy makeUppercase function.

Hope it helps.

Note: To deploy more than one function at once (but not all) use:

$ firebase deploy --only functions:function1,functions:function2

Make sure you are editing the functions in your "functions/src" directory and not the functions in your 'lib' directory. I made this mistake and watched them get replaced...