@@ -44,6 +44,8 @@ pub(crate) enum ItemId {
44
44
45
45
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
46
46
pub ( crate ) enum ItemIdGroupKind {
47
+ /// Used only for testing
48
+ #[ allow( unused) ]
47
49
ModuleEvaluation ,
48
50
/// `(local, export_name)``
49
51
Export ( Id , Atom ) ,
@@ -130,6 +132,8 @@ pub(crate) struct ItemData {
130
132
131
133
/// Server actions breaks when we merge exports.
132
134
pub disable_export_merging : bool ,
135
+
136
+ pub is_module_evaluation : bool ,
133
137
}
134
138
135
139
impl fmt:: Debug for ItemData {
@@ -145,6 +149,8 @@ impl fmt::Debug for ItemData {
145
149
. field ( "side_effects" , & self . side_effects )
146
150
. field ( "export" , & self . export )
147
151
. field ( "explicit_deps" , & self . explicit_deps )
152
+ . field ( "disable_export_merging" , & self . disable_export_merging )
153
+ . field ( "is_module_evaluation" , & self . is_module_evaluation )
148
154
. finish ( )
149
155
}
150
156
}
@@ -165,6 +171,7 @@ impl Default for ItemData {
165
171
binding_source : Default :: default ( ) ,
166
172
explicit_deps : Default :: default ( ) ,
167
173
disable_export_merging : Default :: default ( ) ,
174
+ is_module_evaluation : Default :: default ( ) ,
168
175
}
169
176
}
170
177
}
@@ -389,10 +396,10 @@ impl DepGraph {
389
396
}
390
397
}
391
398
392
- for item in group {
393
- match item {
399
+ for item_id in group {
400
+ match item_id {
394
401
ItemId :: Group ( ItemIdGroupKind :: Export ( ..) ) => {
395
- if let Some ( export) = & data[ item ] . export {
402
+ if let Some ( export) = & data[ item_id ] . export {
396
403
outputs. insert ( Key :: Export ( export. as_str ( ) . into ( ) ) , ix as u32 ) ;
397
404
398
405
let s = ExportSpecifier :: Named ( ExportNamedSpecifier {
@@ -418,11 +425,12 @@ impl DepGraph {
418
425
) ) ;
419
426
}
420
427
}
421
- ItemId :: Group ( ItemIdGroupKind :: ModuleEvaluation ) => {
422
- outputs. insert ( Key :: ModuleEvaluation , ix as u32 ) ;
423
- }
424
428
425
- _ => { }
429
+ _ => {
430
+ if data[ item_id] . is_module_evaluation {
431
+ outputs. insert ( Key :: ModuleEvaluation , ix as u32 ) ;
432
+ }
433
+ }
426
434
}
427
435
}
428
436
@@ -1369,21 +1377,21 @@ impl DepGraph {
1369
1377
}
1370
1378
}
1371
1379
1372
- {
1373
- // `module evaluation side effects` Node
1374
- let id = ItemId :: Group ( ItemIdGroupKind :: ModuleEvaluation ) ;
1375
- ids. push ( id. clone ( ) ) ;
1376
- items. insert (
1377
- id,
1378
- ItemData {
1379
- content : ModuleItem :: Stmt ( Stmt :: Expr ( ExprStmt {
1380
- span : DUMMY_SP ,
1381
- expr : "module evaluation" . into ( ) ,
1382
- } ) ) ,
1383
- ..Default :: default ( )
1384
- } ,
1385
- ) ;
1386
- }
1380
+ // {
1381
+ // // `module evaluation side effects` Node
1382
+ // let id = ItemId::Group(ItemIdGroupKind::ModuleEvaluation);
1383
+ // ids.push(id.clone());
1384
+ // items.insert(
1385
+ // id,
1386
+ // ItemData {
1387
+ // content: ModuleItem::Stmt(Stmt::Expr(ExprStmt {
1388
+ // span: DUMMY_SP,
1389
+ // expr: "module evaluation".into(),
1390
+ // })),
1391
+ // ..Default::default()
1392
+ // },
1393
+ // );
1394
+ // }
1387
1395
1388
1396
for ( local, export_name, disable_export_merging) in exports {
1389
1397
let id = ItemId :: Group ( ItemIdGroupKind :: Export ( local. clone ( ) , export_name. clone ( ) ) ) ;
0 commit comments