Skip to content

Commit

Permalink
Fix internal mjs/mts references as well (#5458)
Browse files Browse the repository at this point in the history
### Description

In #5457, I fixed internal .jsx?/.tsx? references not being processed.
However, it turns out we also use `.mjs` for structured images in
Next.js, which also use internal references.

### Testing Instructions

Next.js CI
  • Loading branch information
alexkirsz authored Jul 4, 2023
1 parent b60f363 commit c9868f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/turbopack/src/module_options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl ModuleOptionsVc {
options: ecmascript_options,
})],
),
ModuleRule::new(
ModuleRule::new_all(
ModuleRuleCondition::ResourcePathEndsWith(".mjs".to_string()),
vec![ModuleRuleEffect::ModuleType(ModuleType::Ecmascript {
transforms: app_transforms,
Expand All @@ -245,7 +245,7 @@ impl ModuleOptionsVc {
},
})],
),
ModuleRule::new(
ModuleRule::new_all(
ModuleRuleCondition::ResourcePathEndsWith(".cjs".to_string()),
vec![ModuleRuleEffect::ModuleType(ModuleType::Ecmascript {
transforms: app_transforms,
Expand All @@ -272,7 +272,7 @@ impl ModuleOptionsVc {
})
}],
),
ModuleRule::new(
ModuleRule::new_all(
ModuleRuleCondition::any(vec![
ModuleRuleCondition::ResourcePathEndsWith(".mts".to_string()),
ModuleRuleCondition::ResourcePathEndsWith(".mtsx".to_string()),
Expand All @@ -295,7 +295,7 @@ impl ModuleOptionsVc {
})
}],
),
ModuleRule::new(
ModuleRule::new_all(
ModuleRuleCondition::any(vec![
ModuleRuleCondition::ResourcePathEndsWith(".cts".to_string()),
ModuleRuleCondition::ResourcePathEndsWith(".ctsx".to_string()),
Expand Down

0 comments on commit c9868f7

Please sign in to comment.