JSPM

@docusaurus/mdx-loader

2.0.0-alpha.10
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1205671
  • Score
    100M100P100Q198880F
  • License MIT

Docusaurus Loader for MDX

Package Exports

  • @docusaurus/mdx-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@docusaurus/mdx-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@docusaurus/mdx-loader

Docusaurus webpack loader of MDX

The extra idea here is to simplify things by adding prismjs syntax highlighting by default through https://github.com/mapbox/rehype-prism and add the prism css theme import directly (only add the CSS import if target is 'web').

Installation

yarn add @docusaurus/mdx-loader

Usage

// ...
module: {
  rules: [
    // ...
    {
        test: /\.css$/,
        // Make sure your webpack loader can import css files too
    },
    {
      test: /\.mdx?$/,
      use: [
        'babel-loader',
        {
            loader: '@docuaurus/mdx-loader',
            options: {
                // .. See options
            }
        }
      ]
    }
  ]
}

Options

prismTheme

  • Default: prism-themes/themes/prism-atom-dark.css;

This is the PrismJS theme CSS that will be imported. The supported themes are :