Skip to content

Commit

Permalink
rewrite_as instead of ModuleType::Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Jul 25, 2024
1 parent 23ea918 commit 8d81b7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/turbopack-mdx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct MdxTransformedAsset {
impl Source for MdxTransformedAsset {
#[turbo_tasks::function]
fn ident(&self) -> Vc<AssetIdent> {
self.source.ident()
self.source.ident().rename_as("*.tsx".into())
}
}

Expand Down
14 changes: 3 additions & 11 deletions crates/turbopack/src/module_options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,9 @@ impl ModuleOptions {
ModuleRuleCondition::ResourcePathEndsWith(".md".to_string()),
ModuleRuleCondition::ResourcePathEndsWith(".mdx".to_string()),
]),
vec![
ModuleRuleEffect::ModuleType(ModuleType::Typescript {
transforms: ts_app_transforms,
tsx: true,
analyze_types: false,
options: ecmascript_options_vc,
}),
ModuleRuleEffect::SourceTransforms(Vc::cell(vec![Vc::upcast(
MdxTransform::new(mdx_transform_options),
)])),
],
vec![ModuleRuleEffect::SourceTransforms(Vc::cell(vec![
Vc::upcast(MdxTransform::new(mdx_transform_options)),
]))],
));
}

Expand Down

0 comments on commit 8d81b7c

Please sign in to comment.