当您部署一个firebase函数并具有公共依赖关系时会发生什么情况?
以下面的例子为例:当您部署一个firebase函数并具有公共依赖关系时会发生什么情况?,firebase,google-cloud-functions,Firebase,Google Cloud Functions,以下面的例子为例: //index.ts import * as functions from "firebase-functions"; import { mathFunction } from './helpers' export const functionOne = = functions.https.onCall(async (data, context) => { return mathFunction(data.a,data.b) }) expor
//index.ts
import * as functions from "firebase-functions";
import { mathFunction } from './helpers'
export const functionOne = = functions.https.onCall(async (data, context) => {
return mathFunction(data.a,data.b)
})
export const functionTwo = = functions.https.onCall(async (data, context) => {
return mathFunction(data.a,data.b)
})
//helpers.ts
export const mathFunction = = (a:number,b:number) => {
return a+b
})
如果我修改“mathFunction”,然后
firebase部署--仅函数:functionOne
,会发生什么?functionTwo是否使用新版本的mathFuntion?每个导出的函数都在自己的容器中运行,这些容器在部署该函数时生成/重建。因此,如果运行firebase部署--only functions:functionOne
,则只有functionOne
将使用更新的依赖项运行。functionTwo
的容器将不被修改,并使用其旧的依赖项版本运行。每个导出的函数都在其自己的容器中运行,这些容器在部署该函数时生成/重新生成。因此,如果运行firebase部署--only functions:functionOne
,则只有functionOne
将使用更新的依赖项运行。functionTwo
的容器将不被修改,并使用其旧的依赖项版本运行