docusaurus/packages/docusaurus-mdx-loader
Sébastien Lorber d33004da1e
chore: upgrade monorepo to TS 5.8 (#10966)
* Upgrade to TS 5.8

* increase build perf CI timeout values

* enable erasableSyntaxOnly

* enable erasableSyntaxOnly
2025-03-06 12:33:11 +01:00
..
src chore: upgrade monorepo to TS 5.8 (#10966) 2025-03-06 12:33:11 +01:00
.npmignore misc: make copyUntypedFiles work for watch mode (#7445) 2022-05-18 19:18:32 +08:00
package.json chore: release Docusaurus 3.7.0 (#10812) 2025-01-03 18:11:21 +01:00
README.md refactor: create @docusaurus/bundler and @docusaurus/babel packages (#10511) 2024-09-21 16:35:49 +02:00
tsconfig.json chore: simplify TypeScript configs, use TS 5.5 configDir placeholder (#10256) 2024-07-01 17:34:40 +02:00

@docusaurus/mdx-loader

Docusaurus webpack loader for MDX.

Installation

yarn add @docusaurus/mdx-loader

Usage

// ...
module: {
  rules: [
    // ...
    {
      test: /\.mdx?$/,
      use: [
        {
          loader: '@docusaurus/mdx-loader',
          options: {
            // .. See options
          },
        },
      ],
    },
  ];
}

Options

rehypePlugins

Array of rehype plugins to manipulate the MDXHAST

remarkPlugins

Array of remark plugins to manipulate the MDXAST

metadataPath

A function to provide the metadataPath depending on current loaded MDX path that will be exported as the MDX metadata.

markdownConfig

The global Docusaurus Markdown config (config.markdown), that plugin authors should forward:

const loader = {
  loader: require.resolve('@docusaurus/mdx-loader'),
  options: {
    markdownConfig: siteConfig.markdown,
  },
};