简体   繁体   English

有没有办法向正在运行的 firebase 仿真器添加/修改功能?

[英]Is there a way to add/modify functions to a running firebase emulator?

I am using a firebase emulator to develop and test cloud functions.我正在使用 firebase 仿真器来开发和测试云功能。 Every time I modify an existing function or when I want to add a new function, I essentially shut down the emulator, deploy the functions, and then restart the emulator.每次我修改现有的 function 或想要添加新的 function 时,我基本上都会关闭模拟器,部署功能,然后重新启动模拟器。 In this process, I lose all the data in the local firestore database (as a part of the emulator).在这个过程中,我丢失了本地 firestore 数据库中的所有数据(作为模拟器的一部分)。 Is there a way to deploy functions to incorporate modifications to existing functions as well as to include new functions without shutting down the emulator?有没有办法在不关闭模拟器的情况下部署功能以合并对现有功能的修改以及包含新功能?

It seems to depend what you are deploying.这似乎取决于您要部署的内容。 There is a not in Firebase documentation : Firebase 文档中没有:

Note : Code changes you make during an active session are automatically reloaded by the emulator.注意:您在活动 session 期间所做的代码更改将由模拟器自动重新加载。 If your code needs to be transpiled (TypeScript, React) make sure to do so before running the emulator.如果您的代码需要转译(TypeScript、React),请确保在运行模拟器之前这样做。

So if you generally you can run the emulator and when you change the code without stopping it, with exception of the languages mentioned in the note.因此,如果您通常可以运行模拟器,并且当您更改代码而不停止它时,注释中提到的语言除外。

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

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