A batteries-included webpack loader for converting Markdown files into React components using MDX. Version 3.0.2 (latest) builds on mdx-js/mdx to provide emoji support (remark-emoji), automatic image embedding (remark-images), heading IDs (remark-slug), Prism.js syntax highlighting (rehype-prism), front matter export (gray-matter), table of contents (mdx-table-of-contents), and typographic improvements (remark-textr). Released as part of the mdx-util monorepo, it offers a zero-config experience for Webpack projects and can also be used inline with create-react-app via webpack loader syntax. Releases are infrequent; the loader uses MDX v1 and has not been updated for MDX v2, which is a breaking change. Key differentiator: all-in-one setup without needing separate remark/rehype plugins.
npm install mdx-loaderVerified import paths — ran on the pinned version, not inferred.
Webpack configuration to process .mdx files with mdx-loader and babel-loader, and a React component importing the MDX document, its front matter, and table of contents.
Use a different loader like @mdx-js/loader, or stay on MDX v1.
Migrate to @mdx-js/loader or next-mdx-remote for newer MDX features.
Ensure babel-loader is installed and configured (e.g., @babel/preset-env).
Add `import 'prismjs/themes/prism-tomorrow.css'` in your app entry.
Add { test: /\.mdx$/, use: ['babel-loader', 'mdx-loader'] } to module.rules.Run `npm install --save-dev @mdx-js/mdx`
Ensure the markdown file has YAML front matter delimited by '---'. Also verify that mdx-loader is in the webpack config.