---
title: mdxRs
description: Use the new Rust compiler to compile MDX files in the App Router.
url: "https://nextjs.org/docs/15/app/api-reference/config/next-config-js/mdxRs"
version: 15.5.15
lastUpdated: 2025-06-16
prerequisites:
  - "Configuration: /docs/15/app/api-reference/config"
  - "next.config.js: /docs/15/app/api-reference/config/next-config-js"
---


For experimental use with `@next/mdx`. Compiles MDX files using the new Rust compiler.

```js filename="next.config.js"
const withMDX = require('@next/mdx')()

/** @type {import('next').NextConfig} */
const nextConfig = {
  pageExtensions: ['ts', 'tsx', 'mdx'],
  experimental: {
    mdxRs: true,
  },
}

module.exports = withMDX(nextConfig)
```
---

For an index of all available documentation, see [/docs/15/llms.txt](/docs/15/llms.txt)