docusaurus/packages/docusaurus-mdx-loader
Armano 411b9aa977
chore: cleanup dependency declaration in package.json (#5985)
* deps: add/move dependencies and treat types as dev

* chore: fix merge conflict

* Update package.json

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-11-23 13:59:28 +08:00
..
src feat(core): allow sourcing from multiple static directories (#4095) 2021-11-18 22:26:26 +08:00
package.json chore: cleanup dependency declaration in package.json (#5985) 2021-11-23 13:59:28 +08:00
README.md docs(v2): Add READMEs to v2 packages (#4034) 2021-01-14 17:16:26 +01:00
tsconfig.json refactor: improve setup of type declaration files (#5914) 2021-11-12 17:47:27 +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.