Skip to content

Commit a8857e6

Browse files
committed
support -D dart environment variables
1 parent fc32eb6 commit a8857e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

frontend_server_client/lib/src/frontend_server_client.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class FrontendServerClient {
6868
bool printIncrementalDependencies = true,
6969
List<String> additionalSources = const [],
7070
String? nativeAssets,
71+
// -D=key=value arguments for dart environment variables
72+
Map<String, String>? dartDefines,
7173
}) async {
7274
final commonArguments = <String>[
7375
'--sdk-root',
@@ -97,6 +99,9 @@ class FrontendServerClient {
9799
'--native-assets',
98100
nativeAssets,
99101
],
102+
if (dartDefines != null) ...[
103+
for (var entry in dartDefines.entries) '-D=${entry.key}=${entry.value}',
104+
],
100105
];
101106
late final Process feServer;
102107
if (frontendServerPath != null) {

0 commit comments

Comments
 (0)