docusaurus/packages/docusaurus-mdx-loader
2022-01-29 10:29:03 +08:00
..
src test: rename 'fixtures' to '__fixtures__' (#6474) 2022-01-27 09:30:09 +08:00
.npmignore misc: convert all internal scripts to ESM (#6286) 2022-01-08 12:59:28 +08:00
package.json fix: updating peerDependency fields for yarn berry (#6498) 2022-01-29 10:29:03 +08:00
README.md
tsconfig.json

@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.