在没有互联网连接的情况下使用 Firebase 模拟器

时间:2021-04-27 17:15:13

标签: firebase firebase-tools

似乎当您使用 firebase 模拟器但没有互联网连接时,您无法加载 Firebase 脚本,例如 http://localhost:5000/__/firebase/8.4.2/firebase-app.js,firebase 模拟器创建的本地服务器必须实际获取 firebase-app.js来自 google firebase 服务器并通过本地主机返回。

是否可以在没有互联网连接的情况下使用 Firebase 模拟器?

1 个答案:

答案 0 :(得分:2)

此处的 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Debug Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "stopOnEntry": true, "justMyCode": false } ] } 本地处理程序除了重定向 Internet 上的 SDK 之外,并没有做更多的事情。否则模拟器套件必须包含所有 Firebase SDK 的许多版本,这是不可行的。

因此,如果您想要完整的离线开发,您必须从属于您自己的网络应用程序的本地路径中包含 SDK,或者确保它们在离线之前从 CDN 中预加载和缓存。