Remark TS to JS
A remark plugin to transform TypeScript codeblocks into two tabs of codeblock with its JavaScript variant.
Usage
Install dependencies:
Add oxc-transform
to serverExternalPackages
in next.config.mjs
:
Add the remark plugin (e.g. for Fumadocs MDX):
Finally, make sure to define the required MDX components: Tabs
and Tab
.
You can now enable it on TypeScript/TSX codeblocks, like:
Edit on GitHub
Last updated on