简体   繁体   English

如何部署firebase云函数依赖需要js

[英]How to deploy firebase cloud function dependencies require js

I am using node.js to deploy firebase cloud function, I got a problem I have some js files require my custom functions.我正在使用 node.js 来部署 firebase 云函数,我遇到了一个问题,我有一些 js 文件需要我的自定义函数。 When my custom function is updated, how can I deploy it?当我的自定义函数更新时,我该如何部署它? For instance, I have two js files Purchase.js and MyTime.js例如,我有两个 js 文件 Purchase.js 和 MyTime.js

Puchase.js const MyTime = require('../Scoz/MyTime.js'); Puchase.js const MyTime = require('../Scoz/MyTime.js');

MyTime.js some methods MyTime.js一些方法

If I only modified MyTime.js how can I deploy it?如果我只修改了 MyTime.js,我该如何部署它? Normally, I use firebase deploy --only functions: Purchase to deploy function, but if I only want to update "MyTime.js".通常,我使用 firebase deploy --only 函数:购买部署函数,但如果我只想更新“MyTime.js”。 How can I do?我能怎么做?

Many thanks非常感谢

You cannot just update those custom function (which are not cloud functions).您不能只更新那些自定义函数(不是云函数)。 You would have to deploy the function(s) which uses that custom functions.您必须部署使用该自定义函数的函数。

firebase deploy --only functions:cloudFunctionOne

This will deploy only cloudFunctionOne and if I recall correctly, the custom function will be updated for this cloud function only.这将仅部署cloudFunctionOne ,如果我cloudFunctionOne话,自定义函数将仅为此云函数更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM