Skip to content

Commit

Permalink
Match assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Aug 30, 2024
1 parent e32f579 commit 2ce1fd8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,21 @@ impl DepGraph {

let s = ExportSpecifier::Named(ExportNamedSpecifier {
span: DUMMY_SP,
orig: ModuleExportName::Ident(Ident::new(
local.0.clone(),
DUMMY_SP,
local.1,
)),
orig: if export == "default" {
// references/mod.rs makes some assumptions about default
// exports.
ModuleExportName::Ident(Ident::new(
"default".into(),
DUMMY_SP,
Default::default(),
))
} else {
ModuleExportName::Ident(Ident::new(
local.0.clone(),
DUMMY_SP,
local.1,
))
},
exported: Some(ModuleExportName::Ident(Ident::new(
export.clone(),
DUMMY_SP,
Expand Down

0 comments on commit 2ce1fd8

Please sign in to comment.