Commit cc81b3e2 authored by Tobias Koppers's avatar Tobias Koppers

code simplification

parent a4e74c97
......@@ -193,17 +193,13 @@ async fn apply_module_type(
))
}
Some(TreeShakingMode::ReexportsOnly) => {
if let Some(part) = part {
match part {
ModulePart::Evaluation => {
if *module.get_exports().split_locals_and_reexports().await? {
if *module.get_exports().split_locals_and_reexports().await? {
if let Some(part) = part {
match part {
ModulePart::Evaluation => {
Vc::upcast(EcmascriptModuleLocalsModule::new(*module))
} else {
Vc::upcast(*module)
}
}
ModulePart::Export(_) => {
if *module.get_exports().split_locals_and_reexports().await? {
ModulePart::Export(_) => {
apply_reexport_tree_shaking(
Vc::upcast(
EcmascriptModuleFacadeModule::new(
......@@ -216,22 +212,19 @@ async fn apply_module_type(
part,
)
.await?
} else {
apply_reexport_tree_shaking(Vc::upcast(*module), part)
.await?
}
_ => bail!(
"Invalid module part \"{}\" for reexports only tree \
shaking mode",
part
),
}
_ => bail!(
"Invalid module part \"{}\" for reexports only tree shaking \
mode",
part
),
} else {
Vc::upcast(EcmascriptModuleFacadeModule::new(
Vc::upcast(*module),
ModulePart::facade(),
))
}
} else if *module.get_exports().split_locals_and_reexports().await? {
Vc::upcast(EcmascriptModuleFacadeModule::new(
Vc::upcast(*module),
ModulePart::facade(),
))
} else {
Vc::upcast(*module)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment