File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { logger } from "./developmentServer";
1212import { Emulators } from "../types" ;
1313import { getLocalAppHostingConfiguration } from "./config" ;
1414import { resolveProjectPath } from "../../projectPath" ;
15+ import { EmulatorRegistry } from "../registry" ;
16+ import { setEnvVarsForEmulators } from "../env" ;
1517
1618interface StartOptions {
1719 port ?: number ;
@@ -55,6 +57,7 @@ async function serve(
5557 }
5658
5759 const environmentVariablesToInject = {
60+ ...getEmulatorEnvs ( ) ,
5861 ...environmentVariablesAsRecord ,
5962 PORT : port . toString ( ) ,
6063 } ;
@@ -81,3 +84,12 @@ function availablePort(host: string, port: number): Promise<boolean> {
8184 family : isIPv4 ( host ) ? "IPv4" : "IPv6" ,
8285 } ) ;
8386}
87+
88+ function getEmulatorEnvs ( ) : Record < string , string > {
89+ const envs : Record < string , string > = { } ;
90+ let emulatorInfos = EmulatorRegistry . listRunningWithInfo ( ) ;
91+
92+ setEnvVarsForEmulators ( envs , emulatorInfos ) ;
93+
94+ return envs ;
95+ }
You can’t perform that action at this time.
0 commit comments