@@ -26,6 +26,9 @@ class ResolverOptions {
26
26
/// List of paths used for the multi-package resolver.
27
27
final List <String > packagePaths;
28
28
29
+ /// List of additional non-Dart resources to resolve and serve.
30
+ final List <String > resources;
31
+
29
32
/// Whether to infer return types and field types from overriden members.
30
33
final bool inferFromOverrides;
31
34
static const inferFromOverridesDefault = true ;
@@ -60,7 +63,7 @@ class ResolverOptions {
60
63
static const String implicitHtmlFile = 'index.html' ;
61
64
62
65
ResolverOptions ({this .useMultiPackage: false , this .packageRoot: 'packages/' ,
63
- this .packagePaths: const < String > [],
66
+ this .packagePaths: const < String > [], this .resources : const < String > [],
64
67
this .inferFromOverrides: inferFromOverridesDefault,
65
68
this .inferTransitively: inferTransitivelyDefault,
66
69
this .onlyInferConstsAndFinalFields: onlyInferConstAndFinalFieldsDefault,
@@ -192,6 +195,10 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
192
195
@override
193
196
final List <String > packagePaths;
194
197
198
+ /// List of additional non-Dart resources to resolve and serve.
199
+ @override
200
+ final List <String > resources;
201
+
195
202
/// Whether to infer types downwards from local context
196
203
@override
197
204
final bool inferDownwards;
@@ -239,7 +246,7 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
239
246
this .outputDart: false , this .useColors: true ,
240
247
this .covariantGenerics: true , this .relaxedCasts: true ,
241
248
this .useMultiPackage: false , this .packageRoot: 'packages/' ,
242
- this .packagePaths: const < String > [],
249
+ this .packagePaths: const < String > [], this .resources : const < String > [],
243
250
this .inferDownwards: RulesOptions .inferDownwardsDefault,
244
251
this .inferFromOverrides: ResolverOptions .inferFromOverridesDefault,
245
252
this .inferTransitively: ResolverOptions .inferTransitivelyDefault,
@@ -304,6 +311,7 @@ CompilerOptions parseOptions(List<String> argv) {
304
311
useMultiPackage: args['use-multi-package' ],
305
312
packageRoot: args['package-root' ],
306
313
packagePaths: args['package-paths' ].split (',' ),
314
+ resources: args['resources' ].split (',' ),
307
315
inferDownwards: args['infer-downwards' ],
308
316
inferFromOverrides: args['infer-from-overrides' ],
309
317
inferTransitively: args['infer-transitively' ],
@@ -377,6 +385,8 @@ final ArgParser argParser = new ArgParser()
377
385
..addOption ('package-paths' ,
378
386
help: 'if using the multi-package resolver, the list of directories to\n '
379
387
'look for packages in.' , defaultsTo: '' )
388
+ ..addOption ('resources' ,
389
+ help: 'Additional resources to serve' , defaultsTo: '' )
380
390
..addFlag ('source-maps' ,
381
391
help: 'Whether to emit source map files' , defaultsTo: true )
382
392
..addOption ('runtime-dir' ,
0 commit comments