docusaurus/packages/docusaurus-mdx-loader
2022-11-10 16:07:18 +01:00
..
src feat: support mermaid code blocks in Markdown (#7490) 2022-10-14 18:07:20 +02:00
.npmignore misc: make copyUntypedFiles work for watch mode (#7445) 2022-05-18 19:18:32 +08:00
package.json fix(mermaid): fix Mermaid integration for v9.2 release (#8282) 2022-11-10 16:07:18 +01:00
README.md docs(v2): Add READMEs to v2 packages (#4034) 2021-01-14 17:16:26 +01:00
tsconfig.json chore: upgrade to TS 4.7, compile with NodeNext (#7586) 2022-06-15 19:15:11 +02:00

@docusaurus/mdx-loader

Docusaurus webpack loader for MDX.

Installation

yarn add @docusaurus/mdx-loader

Usage

// ...
module: {
  rules: [
    // ...
    {
      test: /\.mdx?$/,
      use: [
        'babel-loader',
        {
          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.