@@ -57,6 +57,9 @@ pub struct ModuleRecord<'a> {
57
57
/// Local exported bindings
58
58
pub exported_bindings : FxHashMap < Atom < ' a > , Span > ,
59
59
60
+ /// Dynamic import expressions `import(specifier)`.
61
+ pub dynamic_imports : Vec < ' a , DynamicImport > ,
62
+
60
63
/// Span position of `import.meta`.
61
64
pub import_metas : Vec < ' a , Span > ,
62
65
}
@@ -72,6 +75,7 @@ impl<'a> ModuleRecord<'a> {
72
75
indirect_export_entries : Vec :: new_in ( allocator) ,
73
76
star_export_entries : Vec :: new_in ( allocator) ,
74
77
exported_bindings : FxHashMap :: default ( ) ,
78
+ dynamic_imports : Vec :: new_in ( allocator) ,
75
79
import_metas : Vec :: new_in ( allocator) ,
76
80
}
77
81
}
@@ -374,6 +378,15 @@ pub struct RequestedModule {
374
378
pub is_import : bool ,
375
379
}
376
380
381
+ /// Dynamic import expression.
382
+ #[ derive( Debug , Clone , Copy ) ]
383
+ pub struct DynamicImport {
384
+ /// Span of the import expression.
385
+ pub span : Span ,
386
+ /// Span the ModuleSpecifier, which is an expression.
387
+ pub module_request : Span ,
388
+ }
389
+
377
390
#[ cfg( test) ]
378
391
mod test {
379
392
use oxc_span:: Span ;
0 commit comments