From c9868f7310dfd1edc57e0e3d975394e8f7086c39 Mon Sep 17 00:00:00 2001 From: Alex Kirszenberg Date: Tue, 4 Jul 2023 16:10:44 +0200 Subject: [PATCH] Fix internal mjs/mts references as well (#5458) ### 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 --- crates/turbopack/src/module_options/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/turbopack/src/module_options/mod.rs b/crates/turbopack/src/module_options/mod.rs index 84c01cc292011..82eb0e3a8c2f9 100644 --- a/crates/turbopack/src/module_options/mod.rs +++ b/crates/turbopack/src/module_options/mod.rs @@ -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, @@ -245,7 +245,7 @@ impl ModuleOptionsVc { }, })], ), - ModuleRule::new( + ModuleRule::new_all( ModuleRuleCondition::ResourcePathEndsWith(".cjs".to_string()), vec![ModuleRuleEffect::ModuleType(ModuleType::Ecmascript { transforms: app_transforms, @@ -272,7 +272,7 @@ impl ModuleOptionsVc { }) }], ), - ModuleRule::new( + ModuleRule::new_all( ModuleRuleCondition::any(vec![ ModuleRuleCondition::ResourcePathEndsWith(".mts".to_string()), ModuleRuleCondition::ResourcePathEndsWith(".mtsx".to_string()), @@ -295,7 +295,7 @@ impl ModuleOptionsVc { }) }], ), - ModuleRule::new( + ModuleRule::new_all( ModuleRuleCondition::any(vec![ ModuleRuleCondition::ResourcePathEndsWith(".cts".to_string()), ModuleRuleCondition::ResourcePathEndsWith(".ctsx".to_string()),