docusaurus/packages/docusaurus-mdx-loader
Joshua Chen aa5a2d4c04
test: enable a few jest eslint rules (#6900)
* test: enable a few jest eslint rules

* more
2022-03-12 08:43:09 +08:00
..
src test: enable a few jest eslint rules (#6900) 2022-03-12 08:43:09 +08:00
.npmignore misc: convert all internal scripts to ESM (#6286) 2022-01-08 12:59:28 +08:00
package.json chore: upgrade dependencies (#6879) 2022-03-09 07:34:35 +08:00
README.md docs(v2): Add READMEs to v2 packages (#4034) 2021-01-14 17:16:26 +01:00
tsconfig.json misc: ignore some files during npm publish (#6092) 2021-12-17 11:38:26 +01: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.